******************************************************************************** EMACS COMMANDS SUMMARY Version: GNU Emacs 21.2.1 (Redhat) - but will probably work for most versions compiled by Gaurang Khetan (http://gaurang.org) ******************************************************************************** MOVEMENT C-f, C-b Forward, Backward C-p, C-n Previous line, Next line M-f, M-b Forward one word, Backward one C-a, C-e Start of line, End of Line M-a, M-e Start of Sentence, End of Sentence M-{, M-} Start of Paragraph, End of Paragraph C-v, M-v PageDown, PageUp M-<, M-> Start of Buffer, End of Buffer C-x[, C-x ] Previous Page, Next Page - pages being delimited by page breaks M-x goto-line Goto Line Number M-x goto-char Goto character number C-l Centre the current line and also redraw the display FILE C-x C-f Find File i.e Open File C-x C-s Save File C-x C-w Write File i.e. Save File as C-x C-v Find Alternate File i.e Open File into THE CURRENT buffer replacing the current contents. C-x i Insert File at the point C-x C-c End Emacs Session M-x revert-file Open this file as was saved last rejecting the current state of the file M-x recover-file Open the auto-saved file #file# EDIT C-d Delete the character on the point M-d Delete the word on the point Backspace Delete the character back M-d Delete the word back C-k Delete upto end of line C-w Cut M-w Copy C-y Paste M-y Replace the pasted region with a previous region in the kill ring C-x u Undo Command C-/ Undo Command C-t transpose-chars: Exchange this char with the previous one M-t transpose-words: Exchange this word with the previous one C-x C-t transpose-lines: Exchange this lines with the previous one SEARCH/REPLACE C-s isearch-forward: Incremental search forward C-r isearch-backward: Incremental search backward C-s C-w isearch-forward, but also copy the current word on the point to the minibuffer i.e the text to search C-s C-s repeat previous search C-s RETURN simple search forward C-r RETURN simple search backward M-x replace-string Replace string upto the end of the file without prompting M-% Start Query Replace. On prompting, answer with: y, space = yes; n = no; . = replace this and quit; , = replace and lemme see; ! = Replace all the rest dont ask; q = quit recursive editing - C-r, exits - ESC C-c M-C-s regexp forward incremental search M-C-r regexp backward incremental search M-C-s RETURN regexp forward nonincremental search M-C-r RETURN regexp backward nonincremental search case-fold-search (variable) t = ignore case unless the string is in mixed or upper case, nil = dont ignore case SPELLCHECKING M-Tab Show me correctly spelled completions of this word M-$ or M-x ispell-word M-x ispell-buffer ABBREVIATIONS M-x abbrev-mode Start Abbreviations mode M-x read-abbrev-file M-x write-abbrev-file C-x a i g Add inverse global C-x a i l Add inverse local M-x list-abbrevs M-x edit-abbrevs M-x kill-all-abbrevs BUFFERS C-x b Change buffer C-x s Save all files C-x k Kill buffer M-x kill-some-buffers Ask to kill all buffers M-x rename-buffer C-x C-q Toggle - make buffer read-only or not C-x C-b Buffer list: Enter=open buffer in that window; 1=open window maximized;o=replace other window with this window s=to be saved; d=to be deleted; x=exectute m=mark buffers to be displayed in windows; v=view WINDOWS C-x 1 Just this window C-x 2 Split Horizontally C-x 3 Split Vertically C-x o Other Windown C-x 0 Delete this window, does not delete the buffer C-x } Make this window wider C-x { Shrink this window horizontally C-x ^ Make this window taller C-x shrink-window Make this window shorter vertically C-x + Divide space vertically equally between windows C-x 4 f Operate on other window with C-x f C-x 4 b similar BOOKMARKS C-x r m bookmark-set: Asks for a name - can have spaces and other characters C-x r b bookmark-jump M-x bookmark-rename M-x bookmark-delete C-x r l bookmark-menu-list: Gives a menu of bookmarks available; similar to commands in C-x C-b MARK COMMANDS C-Spc Set Mark C-x C-x Exchange Mark and Point C-u C-Spc Go back to last mark in the ring C-x r Spc R Save current cursor position in the register 'R' - register is any single character C-x r j R Jump to that location in register R C-x r s R Save the current region of text in the register C-x r i R Insert text from the register at the current location M-x transient-mark-mode Highlight Region, and remove mark when buffer is changed. SHELL M-! execute one shell command M-| execute shell command on region C-u M-! execute shell command and put the output at the current position M-x shell go into a shell, only thing, use C-c C-c instead of just C-c, and C-c C-z instead of just C-z M-x send-invisible used for typing something like passwords DIRED MODE C-x d or M-x dired invode dired mode - asks for directory name or wildcard filenames d put deletion flag to the file on the current line u remove deletion flag from the file on the current line x actually delete those files having the deletion flag # put deletion flag to auto-save files ~ put deletion flag to all backup files % d put deletion flag to files satisfying a regular expression open the file on the current line in a new buffer o open the file in another window and go to that window C-o open the file in another window and remain in this dired window v view a file - will open as read-only * m OR m mark the current file * * mark all executable files * & mark all symbolic links * / mark all directories * s mark all files * u OR u remove the mark * ! remove marks from all files * move to next marked file * move to the previous marked file * t toggle all marks * c change all marks of character c1 with marks of character c2 * % mark all files matching regular expression % g mark all files with content matching regular expression C-_ undo visible changes in the Dired buffer The following commands operate on N files(numeric argument) or else marked files or else current file C NEW copy D delete R NEW rename/move A REGEXP search the files for regexp KEYBOARD MACROS C-x ( start recording macro C-x ) stop recording macro C-x e execute last defined macro M-x name-last-kbd-macro give a name to the macro, that can then be invoked using M-x C-x C-k edit keyboard macro M-x global-set-key to set a key to invoke a M-x command. Use C-c plus something for user-defined keys. M-x global-unset-key to unset it TAGS M-. TAG Find first definition of TAG (`find-tag'). C-u M-. Find next alternate definition of last tag specified. C-u - M-. Go back to previous tag found. C-M-. PATTERN Find a tag whose name matches PATTERN (`find-tag-regexp'). C-u C-M-. Find the next tag whose name matches the last pattern used. C-x 4 . TAG Find first definition of TAG, but display it in another window (`find-tag-other-window'). C-x 5 . TAG Find first definition of TAG, and create a new frame to select the buffer (`find-tag-other-frame'). M-* Pop back to where you previously invoked `M-.' and friends. MISCELLEANOUS C-r enters recursive edit in the middle of some command M-C-c exit recursive edit M-x auto-fill-mode Auto Fill Mode - the one in pico/pine M-q fill-paragraph i.e. Justify the current paragraph - similar to C-j in pico M-x fill-region Fill/i.e. Justify the current region F10 or M-`: Text Based Menus C-u n command Execute command n times M-n command Execute command n times M-x set-variable To change the value of a variable C-h Help Menu C-h k Describe a key binding C-h f Describe an Emacs Function ... a command name C-x ESC ESC To Repeat previous commands - M-p, M-n - to traverse between the commands shown, and RETURN to execute it again C-q QUOTE COMMAND: Puts the next character as a literal rather than interpreting it C-q C-l Puts a PAGE BREAK into the file M-x grep Grepping C-u M-x grep Takes the current word on the point and uses the last query Enter pressing enter on any line of the grep results will take you actually to that line in that file M-` this will take you to the next line M-x compile To run compile from within emacs - useful because clicking on errors takes you to the actual errors, and M-` works M-x gdb Debugger (C-Spc: Set Breakpoint; f on the gdb cmdline will show you the current point) M-x which-function-mode To display the function on the command line M-x imenu To display the list of functions M-x send-invisible To send the characters invisible M-x sql-oracle To start an SQLPlus session M-x customize-variable Gives the current value of the variable and asks you for a new value M-x describe-* Describe various things (functions, etc) M-x find-grep Do a find and a grep C-x v v CVS next action M-/ Autocomplete, keep pressing for more matches (automatically scans the open buffers?) C-M-/ Autocomplete, but shows a buffer with all the matches, and then we can select M-x complete-tag Autocomplete with eTags M-x artist-mode Artist mode to draw ASCII shapes, (left to draw, right to erase, middle for various options like line, ellipse, rectangle, etc) C-M-f Go to the matching forward parenthesis or brace (in C mode) C-M-b Go to the matching backward parenthesis or brace (in C mode)