Tend to forget simple commands that I don't use so much and for improved productivity decided to write them down.
gg
beginning of file
GG
beginning of end of file
$
end of line
^
beginning of line
g_
last non-whitespace character
g$
end of screen
Show hidden characters
:set list
shows
:set nolist
hides hidden characters
set number
set nonumber
dw
deletes word starting from cursor
daw
deletes a whole word
df
deletes from cursor until next space or any other char instead of space, e.g.:
df.
deletes whole sentence, until the dot.
caw
changes a word (deletes and puts into insert mode)
:5,12s/foo/bar/g
Change each 'foo' to 'bar' for all lines from line 5 to line 12 (inclusive).
E.g. when copying from a table and editor parses second row onto a new line.
Works like this: :[range]g/pattern/cmd
To delete all even lines:
:g/^/+d
To delete all odd lines this guy states:
:gg/^/+dd
(?)
gg
qq
cursor down & dd
q
10@q
- Figure out how to delete all odd lines.