This is the first of a many quick brain dumps I will be doing of helpful keyboard-commands for things like bash, vim, OS X, etc. Check back for more goodies and feel free to comment with your own!

REXML could not parse this XML/HTML: 
<pre>Miscelaneous:
:set number (:set nu) shows line numbers.
:set nonumber (:set nonu) removes line numbers.

:sh opens shell in current directory
:! [command] executes command and returns output.

Copy and paste:
yy copy 1 line.
5y copy 5 lines.

dd cut 1 line.
5dd cut 5 lines.

p Paste under current line.

m[char] mark spot [char]. *(char can be any alpha-numeric character)
`[char] go to mark [char]. *(alpha-numeric character used as a mark)

y`[char] yank from current cursor to mark [char]

. repeat last command.

Moving:
:n go to line n
gg move to top of file.
G move to end of file.
w move one word forward.
b move one word backward.
} move one paragraph forward.
{ move one paragraph backward.

Line shifting/indenting:
>> shifts a line one shiftwidth to the right.

Published

25 August 2011