Cut lines that match a regular expression
If you've never done batch editing using ex commands, I hope this will
convince you to try: the ':global' command runs any command on each line
in your file (or range if you give it a range) that matches a regular
expression. Example: ':global/foo/delete' will delete all lines that
contain the letters 'foo'. Instead of 'delete' you can have any ex command
you like, or any normal mode (keystroke) command, e.g, 'global/foo/normal
dd'. If you enter insert mode you need to add the escape tp end your
command by finishing with '<ctrl-v><esc>' (type the keys names, not the
literal text).
Brace matching on steroids
The % command to jump between matching brackets works great for Perl and
C, but shell scripts and some other langages have block-like constructs
that are demited by words like if...elsif...fi instead of brackets.
Matchit.vim provides macros that extend % to find matching keywords. Get
it from <http://sites.netscape.net/BBenjiF/vim/beta/matchit.vim> and use
it by adding 'source matchit.vim' to your .vimrc.
Reclaim your Control-S and Control-Q (really an xterm / console tip)
By default, control s and q start and stop flow control -- a relic of
the days of 300 baud serial terminals that makes little sense in your
xterm. Also, if you hit control-s accidentally, your terminal freezes,
which may be quite disorienting. To turn control s and q back into
ordinary keystrokes, add 'stty -ixon' to you .bashrc.
--
Henry House
OpenPGP key available from http://romana.hajhouse.org/hajhouse.asc
PGP signature