Thursday, June 26, 2014

I hate VIM

Vim to me will always mean the household cleaner: but in the geek world of sysadmin... well, I'm sure it makes beginners scream too.

Like everything there are a few basics that never seem intuitive, so always have to root them out. So here's the most basic commands for server admin heaven:

i insert mode
ESC back to command mode
:q Exit
:w Write
:qa! Quit and abandon changes


h moves the cursor one character to the left.
j moves the cursor down one line.
k moves the cursor up one line.
l moves the cursor one character to the right.
0 moves the cursor to the beginning of the line.
$ moves the cursor to the end of the line.
w move forward one word.
b move backward one word.
G move to the end of the file.
gg move to the beginning of the file.
`. move to the last edit.


d starts the delete operation.
dw will delete a word.
d0 will delete to the beginning of a line.
d$ will delete to the end of a line.
dgg will delete to the beginning of the file.
dG will delete to the end of the file.
u will undo the last operation.
Ctrl-r will redo the last undo.