Gurmeet Manku shares some Emacs Tips n Tricks for Everybody on his homepage. A lot of these will be familiar to most Emacs users and some are things I wouldn’t want to do but it’s a nice list of things you can add to your .emacs
file to make your development work easier and more enjoyable.
One interesting example is a pair of functions that swap the numeric keys with the shifted numeric keys (1 ↔ !, 2 ↔ @, 3 ↔ #, etc.). The idea is that this makes typing faster when editing C/C++ code. A companion function maps __
into ->
and ..
into []
for pointer notation and array indexing. I’m not sure I’d like this but if you do a lot of C/C++ and can deal with the schizophrenia it could be a time saver.
Another useful trick is to add
(modify-syntax-entry ?- "w")
to your emacs-lisp-mode-hook
so that -
is not considered a word delimiter. Similarly,
(modify-syntax-entry ?_ "w")
when added to c-mode-common-hook
will prevent _
from being a word delimiter. I don’t know why this isn’t built into Emacs.
There are a lot of other ideas in the article and it’s well worth a look if you’re interested in ways of streamlining your Emacs work flow.