Emacs commands directory

The following is the list of Commands in Emacs described in my own words and will be updated continuously as my understanding can vary in future. A place to come back and refer as you please.

C-x C-c End the session
C-v Page Down
M-v Page up
C-l Reload Screen
-p Previous line
C-n Next line

C-f move cursor to one character forward
C-b move cursor to one character backward
M-f move cursor to one word forward
M-b move cursor to one word backward
C-a move cursor to the start of the line
C-e move cursor to the end of the line
M-a move cursor to the start of the sentence
M-e move cursor to the end of the sentence
M-< move cursor to the start of the document
M-> move cursor to the end of the document

C-u-0-C-l or C-l C-l set current line as first line on the screen

C-u-n 'n' is repeat count followed by above commands repeats the command n no. of times

C-g to stop a current command from running
C-x-1 show only current window in full screen (closes other windows)

Return - for new line
Insert - Just type along
<DEL> - delete previous character (DEL is backspace key)
C-d delete next character
M-<DEL> kill the word
M-d kill the next word
C-k kill till end of line
M-k kill till end of sentence

C-<SPC> activate Mark (use navigation keys to select from mark)
C-w kill the marked text

C-y yanks the killed text
M-y yanks the first killed text (should be pressed after C-y and can repeat till the needed killed text is yanked)

C-/ undo the last text changes

C-x C-f to find/create a file
C-x C-s Saves the file
C-x C-b list buffers
C-x b switch between buffers
C-x s save buffers to files
C-z exit temporary from emacs
fg or %emacs to return to the temporary session

M-x replace-string replace multiple occurrences of string (in screen after cursor)
M-x recover-this-file recover from auto saved file
M-x text-mode switch to text major mode
M-x fundamental-mode switch to fundamental mode
C-h m see help page of current major mode

M-x auto-fill-mode toggles auto-fill minor mode
C-x f <character-length> sets the allowed character length of line
M-q refill the existing paragraph with new allowed character length

C-s search for a text forward
C-r search for a text reverse

C-s during searching moves cursor to next search result
C-r during search moves cursor to previous search result
<DEL> moves the cursor to start of search result during search

C-x 2 splits windows into two screens horizontally
C-M-v to scroll bottom windows
C-x o to switch between windows
C-x 4 C-f <Filename> opens the file in new windows

C-x 5 2 duplicates the current frame to new frame
C-x 5 0 removes the selected frame (same as close button)
<ESC> <ESC> <ESC> get-out from recursive editing levels
C-h ? tells list of help emacs can provide
C-h c <command> gives brief description of command
C-h k <command> gives detailed description as documentation in new window
C-h v displays documentation variables (TBD)
C-h a file <RETURN> window with list of all M-x commands
C-h i Read included manual
C-h r Read Emacs manual

Leave a Reply