XEmacs Command Cheat Sheet

(by Justine Ehlers)

A note about how emacs handles files:

Note: emacs automatically saves the file(s) you are editing. The name of the autosave file is the same as the name of the file you are editing, with a sharp (#) added to the beginning and to the end. For example, if TnReal.h was being edited, the autosave file would be #TnReal.h#.

When you do a file save, emacs creates (if one does not exist yet) or writes to (one already exists) a backup file. The name of the backup file is the same as the name of the file you are editing, with a tilde (~) added to the end. For example, if TnReal.h had been saved, the backup file would be TnReal.h~

A note about starting multiple xemacs:

When using the vi editor, you have to start multiple vi sessions to edit multiple files. This makes it easy for you to tromp over yourself and lose all your work. For example, suppose I " vi file1 " and edit the same file " vi file1 " in another window. Whichever vi session I write last wins; it doesn't matter if it's the " wrong " one.

xemacs can avoid this problem. It's better to start one xemacs rather than start multiple xemacs. Here's why. With one xemacs session, you can split the window and/or start new frames. xemacs keeps track of all the buffers you're using, even if you're editing the same file more than once. xemacs updates all the buffers with all your changes automatically, no matter if it's one file or one you have two or more views of. For example, if you're in the same place in two files in one xemacs session, changes in one window are automatically show in the other window.

I'm assuming, of course, that most of your editing is in one directory with inter-related files.

emacs Commands
Files open a file {Ctrl+x}{Ctrl+f}
quit a file {Ctrl+x}{Ctrl+c}
save a file {Ctrl+x}{Ctrl+s}
write to a new file {Ctrl+x}{Ctrl+w}
insert a file {Ctrl+x}i
make read only {Esc}xtoggle-read-only{Enter}
Frames make a new frame {Ctrl+x}5f
delete a frame {Ctrl+x}50
split the window, horizontally {Ctrl+x}2
switch to a split window {Ctrl+x}o
make into one window {Ctrl+x}1
revert to the file on disk {Esc}xrevert-buffer{Enter}
Moving Around move by a word {Alt+f}
move by a line {Ctrl+n}
go to certain line {Esc}xgoto-line{Enter}
go to the start of the line {Ctrl+a}
go to the end of the line {Ctrl+e}
go back a word {Esc}b
go back a line {Ctrl+p}
go back to where you last were {Ctrl+u}{Ctrl+Space}
page down {Ctrl+v}
page up {Esc}v
go to the bottom of the file {Alt+RightShift+.}
go to the top of the file {Alt+RightShift+,}
Copying set a mark {Ctrl+Space}
copy to where the mark ends {Esc}w
yank back whatever you copied {Ctrl+y}
Deleting set a mark {Ctrl+Space}
kill to where the mark ends {Ctrl+w}
kill one character {Ctrl+d}
kill by a word {Alt+d}
kill backwards by a word {Esc}{ExtDel}
kill everything from the cursor to the end of the line {Ctrl+k}
kill an entire line {Ctrl+a}{Ctrl+k}{Ctrl+k}
yank back what you deleted {Ctrl+y}
Replace begin a search and replace {Esc}%
replace all occurrences at once !
replace {Space}
skip the replace n
stop the search and replace {Esc}
recursive edit (temporarily suspend, make edits) {Ctrl+r}
continue with the search and replace {Esc}{Ctrl+c}
Transposing switch characters {Ctrl+t}
switch words {Esc}t
switch lines {Ctrl+x}{Ctrl+t}
Changing Case make all lower case {Alt+l}
make into a title {Alt+c}
make all upper case {Alt+u}
Search search {Ctrl+s}
search backwards {Ctrl+r}
Recovery undo edit(s) {Ctrl+x}u
abort the current command {Ctrl+g}
Modes c++ mode {Alt+x}c++-mode{Enter}
makefile mode {Alt+x}makefile-mode{Enter}
overwrite mode {Esc}xoverwrite-mode{Enter}
Repeat Commands repeat a command (done before the command) {Esc}n
where n is a number
Compiling compiling {Alt+x}compile{Enter}


[XEmacs Home] < Previous Next >