Emacs cheat sheet
- C-l – center the line of the cursor
- C-v – one screen down
-
M-v – one screen up
- C-p – previous line
- C-n – next line
- C-f – forward one char
- C-b – backward one char
- M-f – forward one word
- M-b – backward one word
- C-a – beginning of line
- C-e – end of line
- M-a – beginning of sentence
- M-e – end of sentence
- M-< – beginning of text
-
M-> – end of text
-
C-u [n] [command] – do command n times
- C-g – stop emacs
Windows
- C-x 1 – one window - kill all others
- C-x 2 – two windows - open another
- C-x o – go to Other window
- C-M-v – scroll text in other window
- C-x 3 – vertical window??
- C-x 4 C-f – file in new window
Frames
- C-x 5 2 – two frames
- C-x 5 0 – removes selected frame
Deletion
- backspace – delete char before cursor
- C-d – delete char under cursor
- M-backspace – delete word before cursor
- M-d – delete word under the cursor
- C-k – kill from cursor to end of line
- M-k – kill to end of the current sentence
OBS killing = cutting yanking = pasting
Marking
- C-
-- set marker - C-w – kills all in marker
pasting
- C-y – yanks back the text killed. C-k’s accumulates.
- M-y – cycles through earlier kills.
Undo
- C-/ – undo last action
Files
- C-x C-f – open file
- C-x C-s – saves file
- C-x C-b – list all buffers
- C-x b – go to some buffer
- C-x s – save som buffers
Kill emacs
- C-x C-c – kills emacs
M-x commands
- M-x replace-string
- M-x recover-this-file * Autosaving saves in a different file (if computer crashes) – so dont worry ‘bout overwriting
Major modes
- M-x modename Minor modes
-
M-x auto-fill-mode – toggles
- M-q fills the paragraph – no empty space
Searching
- C-s forward search
- C-r backward search *