When I'm working, I pretty much live inside Emacs. It's my IDE, debugger, text editor, email composer, spreadsheet, file manager, and all-around scratch pad.
I've burned Emacs' key bindings into my brain, so I go to great lengths to set them in every program I use. That way, I don't have to context switch my fingers' muscle memory when I task switch from coding to email, to IM, to the web. Task switches may be a fact of life, but other unnecessary mental context switches are evil incarnate.
I recently started using GNU screen's copy/scrollback mode so that I could copy from terminals with the keyboard. I use these commands in my .screenrc to set up Emacs key bindings in screen's copy/scrollback mode:
# emacs keybindings for navigation in copy mode
markkeys ^B=Y:^F=V:h=^B:l=^F:0=^A:$=^E
# C-space sets mark. markkeys does it in screen 4.0 and higher, but 3.9x
# needs the bindkey command. (note the ^@ escape sequence for C-space.)
markkeys ' '=^@
# bindkey -m ^@ stuff ' '
# page up and page down
bindkey -m -k kP stuff Y
bindkey -m -k kN stuff V
# failed attempt to make C-space work in i-search too
# bindkey -m ^@ eval "stuff \033" "stuff ^@"
# special hack for C-e, since it should go *past*
# the last char. -m means this is for copy mode only.
bindkey -m ^e stuff "$^f"
# C-g and other keys just quit copy mode. Esc does nothing.
markkeys \033=\015=^G=^D=h=j=k=l=H=M=L=G=g=y=c=v=a=x=b=e=B=E=w
markkeys @=\033
# control arrows move by words. (set B, e, and w to F keys so that i can
# use them to move by words, but they themselves still quit copy mode.)
markkeys B=[:E=]:b={:e=}:w=>
bindkey -m ^[Od stuff { #"[[}"
bindkey -m ^[Oc stuff ] #"}]^f"
See also:


