-
Notifications
You must be signed in to change notification settings - Fork 0
Useful Vim Commands
shamik edited this page Apr 25, 2024
·
6 revisions
Execute the following in your bash
vimtutor
- Command - press
Esc
on keyboad - Edit - press
i
- View - press v
^
$
a
v
V
y
yy
y$
y^
dd
dw
daw
x
u
Ctrl + r
- Command Mode
- Select the relevant text with cursor
Ctrl + Shift + C
p
- Command Mode
Ctrl + Shift + V
/<pattern>
Use n
to move to the next item found
General pattern:[range]s/{pattern}/{string}/[flags]
. E.g. search in the entire file, confirm before replacing, and case insensitive search(by default it's case sensitive search)
:%s/foo/bar/ci
:w
!q
:wq
q