>I'm looking for neat macros and abbreviations to make editing C and C++
>source faster. I'm also after cool stuff that escapes to the shell and
>invokes some of the standard utilities to manipulate the file you're
>editing.
>I've got some good macros myself and would like to exchange my .exrc with
>any other people who want to edit faster, so we can all spend less time
>infront of a workstation and more time doing other things.
Trick #1: ditch plain old Vi and start using VIM :-)
Some of my fav features of VIM (ask me for details if I'm being too cryptic):
- keyword completion: its no longer a pain to use nice long variable names
that modern programming seems to expect. Type a name like
"KeyReleaseMask" once, and every time afterward, just type "Key" and hit
Ctrl-P.
- automatic searching of include files when needed.
- remembering names and line/col position of last 10 files edited
- permanent bookmarks (use uppercase) - excellent for when you are
constantly re-visiting the same few spots when debugging a module or
something
- autocommands that get executed when you open certain types of files, or
enter and leave windows for certain files
- multiple windows editing single/multiple files
- filename completion, point and shoot editing of filenames. For instance,
you can take the cursor to the filename on this line:
#include <X11/X.h>
and hit "gf" to start editing that file instead. Or "Ctrl-W" and "f" to
start editing it in a split window...
As of VIM 5...
- syntax highlighting based on language. Over 60 languages supported and
counting. Has saved me debugging time already, just by setting the colors
in an intuitive way...
- embeded Perl support (on Unix only, I think...)
There are more. These are just the ones I have managed to think of in a few
minutes.
If you are thinking about "neat timesaving tricks" and "make editing faster",
you really owe it to yourself to try VIM. Feel free to email if you need more
info or help.
Sitaram.