Vim commands most used
1955 Nuffield - older technology can be good and make you very happy… Vi was written in 1977…
I recently found a way to use Vim with my favourite note taking application OneNote so I thought I’d revisit my favourite most used commands.
CapsLock - mapped to escape
h,j,k,l - move cursor
w - move forward by a word
b - move back by a word
{ - move back by paragraph
} - move forward by paragraph
:n - go to line n
o - start writing on next line
x - delete character
dd - delete a line
cc - change whole line
dw - delete word
. - repeat last (useful for deleting a lot)
u - undo
<C - r> - redo
i - insert text at cursor
gg - go to top of document
G - go to end of document
yy - yank line
p - put
v - visual mode (for copying)
ci( - change inside ()
di( - delete inside ()
yi( - yank inside ()
dt" - delete up to "
rp - replace character with p
R - replace mode
J - join next line to this one
~ - capitalise
D - delete to end of line
C - change to end of line
fw - find letter w
; - move again to same character in same direction
A - go to end of line and start inserting
$ - go to end of line (I normally use A as this goes to insert mode too)
0 - go to beginning of line
/ - search
n - next in same direction
N - next in opposite direction
Here are my lesser used commands:
# visual block mode (vertical)
ctrl v, I, move cursor, x - inserts
I - insert at beginning of line
2dd - delete 2 lines
- da” - Delete Around double quotes
- di] - Delete Inside square brackets
-
dap - Delete Around Paragraph
- xp - xdelete paste to Swap 2 characters
These commmands and highlighting style from VimTricks
VSCodeVim
VSCodeVim Roadmap has shows what commands are implemented in my favourite text editor!
<C S e> - Explorer pane
l or enter - back to editor pane
Vimium
Vimium Extension for Chrome and Firefox
j - scroll down
k - scroll up
gg - scroll to top of page
G - scroll to bottom of page
f - follow link in current tab
F - follow link in new tab
H - back
/ - search
' - search on google serach page (puts cursor back into serach box)
? - help
Mail and Vim
Mutt and Reddit thread on setting up with Gmail too
Other lists
Greg Hewgill on Stack Overflow
Windows Keyboard Repeat
This is very useful to make Vim commands mostly navigation feel more responsive eg h,j,k,l and also repeat . in all Vim implementations.
Conclusion
Learning new Vim commands is a never ending journey of frustration and happiness.
Good luck to us all!!!!