I've hacked my emacs configuration quite a lot in order to support some
major modes that I find particularly useful: (php-mode,
html-helper-mode, css-mode and the rather
more specialist lhcb-c++-mode in particular.
I've also gone to a fair bit of trouble to set some of the more ubiquitous
emacs key combinations to a more "normal" behaviour: I've bound C-a
to "select all", use S-[cursor keys] to select regions and
have bound Home and End to go to the start and end
(respectively) of lines rather than the BOF and EOF.
I also use the rather wonderful cua-mode to bring the cut-copy-paste-undo
shortcuts in line with the rest of computing, not least because I found myself
getting some RSI-like hand pains after repeated use of C-y for
pasting! The C-s search binding and C-k kill-line
bindings remain intact since I find them really handy.
I also recommend the AuCTeX package for advanced LaTeX editing
in Emacs, as well as php-elisp, the equivalent functionality
for PHP editing.
Here's a few handy key combinations I wish I'd been told about when I started using emacs:
C-g or ESC ESC ESC: cancel minibrowser sessionC-s: search for textC-r: search for text backwardsC-%: replace text (press space to okay each suggested instanceC-M-%: replace regex (press space to okay each suggested instanceC-[space]: place mark (I don't use this...see above re. region selection)C-w: cut region (std emacs)M-w: copy region (std emacs)C-k: cut lineC-y: paste (yank)C-l: recentre buffer window vertically around active lineC-x C-f: open (find) file in bufferC-x C-s: save buffer to fileC-x C-w: save buffer to new fileC-x C-z: stop (pause) emacs process (re-start with shell fg)C-x k: kill bufferC-x b: change active bufferC-x 1: display only current buffer windowC-x 2: split buffer windowC-x 0: kill current buffer paneC-x 4 f: open file in new windowC-x 4 b: open buffer in new windowC-x 5 2: open new frameC-x 5 0: kill current frameC-x 5 f: open file in new frameC-x 5 b: open buffer in new frameC-x o: switch between active sub-windowC-x D: enter the very nifty dired-modeM-x global-font-lock-mode: toggle syntax highlightingM-x perl-mode: a lot of code highlights fairly well in Perl modeM-x goto-line: jump to lineF10: access menus in text mode (via the minibuffer)M-x byte-compile-file .emacs: compile .emacs or another elisp file for faster operation
For your entertainment, here's a snapshot of my current
.emacs file:
.emacs
As you can see, the .emacs just really includes a load of other elisp
files. So, here they are:
key-bindings.elThis file defines the bindings of key combinations to functions
mode-hooks.elThis file defines the bindings of file-types (by name) to major emacs modes
pickiness.elThis elisp make emacs look and behave the way I want it to (i.e. very differently from the horrible defaults!)
myfunctions.elElisp functions I've written or otherwise hacked together myself