The other day I talked some sort of nonsense about organizing my notes into some sort of coherent blog post. Heck with that. Life is too short. Instead I will just dump them here and hope somebody finds them useful. Maybe later I can do something with it. For now it’s just supplemental material for the official Emacs tutorial.
Functions in the Emacs Tutorial
|C-x C-c||Save and quit Emacs|
|C-g||Cancels entry of a command|
|C-v||Scroll content up|
|M-v||Scroll cowntent down|
|C-l||Redraw window cycling point through center/top/bottom of window|
|C-p||Put point on previous line|
|C-n||Put point on next line|
|C-b||Put point on previous character|
|C-f||Put point on next character|
|M-f||Put point on next word|
|M-b||Put point on previous word|
|C-a||Put point on line start|
|C-e||Put point on line end|
|M-a||Put point on previous sentence start|
|M-e||Put point on next sentence start|
|M-<||Put point on buffer start|
|M→||Put point on buffer end|
|C-u||Begin a numeric argument for the following command|
|C-x 1||Make window fill its frame|
|<character>||Inserts the character you type|
|RETURN||Insert a newline & move point to next line|
|DEL||Delete characters before point|
|C-d||Delete characters after point|
|M-DEL||Delete word before point|
|M-d||Delete word after point|
|C-k||Kill from point to end of line|
|M-k||Kill from point to end of sentence|
|C-SPACE||Start marking a region for later action|
|C-w||Cut text in marked region|
|C-y||Yank (paste) text at point|
|M-y||cycle through kill ring w/last yank|
|C-/||Undo last command|
|C-x C-f||Prompt in minibuffer to open a file in buffer|
|C-x C-s||Save buffer contents to file|
|C-x C-b||Display a list of existing buffers|
|C-x b||Minibuffer prompt switch window view to different buffer|
|C-x s||Prompt to save each changed buffer|
|C-z or C-x C-z||exit Emacs temporarily|
|M-x ||minibuffer - replace instances of a string in buffer after point|
|M-x ||Revisit buffer using last auto-saved contents|
|M-x ||Major mode for editing text for humans to read|
|C-h m||Show documentation for current major and minor modes|
|M-x ||Toggle automatic line breaking|
|M-q||Fill paragraph at / after point.|
|C-s||minibuffer - Do incremental search forward|
|C-r||minibuffer - Do incremental search backward|
|C-x 2||Split selected window horizontally. Selected window becomes top|
|C-M-v||Scroll next window|
|C-x o||Select next window in cyclic window order|
|C-x 1||Make selected window fill its frame|
|C-x 4 C-f||Edit file in other window|
|C-x 5 2||Return newly created frame displaying current buffer|
|C-x 5 0||Delete selected frame|
|C-h ?||Launches interactive help mode|
|C-h c <key>||Prints name of function invoked by |
|C-h k <key>||Display documentation of function invoked by |
|C-h f ||Display documentation of |
|C-h v ||Display documentation of |
|C-h a ||Show all commands with names containing |
|C-h i||Enter the Info documentation browser|
|C-h r||Display the Emacs manual in Info mode|
I found some things noteworthy while building this list.
- Digits or minus sign after
C-uform the numeric argument.
- Default is
- Usually treated as numeric argument
- Sometimes it’s just a flag. The following command changes
behavior based on the presence of
universal-argumentrather than the details of its value
|C-u 8 C-f||Move forward 8 characters|
|C-u C-f||Move forward 4 characters|
|C-u 2 C-v||Scroll screen 2 lines|
Some commands such as
downcase-region C-x C-l are disabled by default in Emacs.
They confuse beginners.
You get an interactive prompt to try it, enable it, and whatever.
There’s no big list of disabled commands. Instead each command has a hook telling whether it’s disabled or not. The EmacsWiki DisabledCommands page presents functions to list and enable disabled functions.
Inserting and Deleting
Everything you type invokes a function.
Most of the alphanumeric keys simply insert the character and move point.
delete-backward-character, trigger functions that relate to behavior users expect when entering those keys.
They take numeric arguments too.
C-u 4 * will insert
**** into the buffer.
Undo ignores movement commands, and
self-insert-command are lumped into groups of up to 20.
Extending the Command Set
There are only so many keys on the average keyboard.
Less common commands get invoked either through an extended keybinding like C-x
<character> or direct invocation via M-x
- Character eXtend
- Named command eXtend (offers tab completion)
Incremental search is like a minibuffer mode. There are special bindings for the keys and everything.
Frames are what what most windowing systems refer to as windows, but Emacs was already using that term.
Frames only work in GUI, because the terminal can only display a single frame at a time.
elscreen for an alternative that works in both terminal and GUI.