GNU Emacs Reference Card

GNU Emacs Reference Card

GNU Emacs Reference Card Motion Multiple Windows (for version 27) entity to move over backward forward When two commands are shown, the second is a similar com- character C-b C-f mand for a frame instead of a window. Starting Emacs word M-b M-f delete all other windows C-x 1 C-x 5 1 line C-p C-n split window, above and below C-x 2 C-x 5 2 To enter GNU Emacs 27, just type its name: emacs go to line beginning (or end) C-a C-e delete this window C-x 0 C-x 5 0 sentence M-a M-e split window, side by side C-x 3 paragraph M-{ M-} scroll other window C-M-v Leaving Emacs page C-x [ C-x ] switch cursor to another window C-x o C-x 5 o sexp C-M-b C-M-f suspend Emacs (or iconify it under X) C-z select buffer in other window C-x 4 b C-x 5 b function C-M-a C-M-e exit Emacs permanently C-x C-c display buffer in other window C-x 4 C-o C-x 5 C-o go to buffer beginning (or end) M-< M-> find file in other window C-x 4 f C-x 5 f Files scroll to next screen C-v find file read-only in other window C-x 4 r C-x 5 r scroll to previous screen M-v run Dired in other window C-x 4 d C-x 5 d scroll left C-x < find tag in other window C-x 4 . C-x 5 . read a file into Emacs C-x C-f scroll right C-x > grow window taller C-x ^ save a file back to disk C-x C-s scroll current line to center, top, bottom C-l save all files C-x s shrink window narrower C-x { goto line M-g g insert contents of another file into this buffer C-x i grow window wider C-x } goto char M-g c replace this file with the file you really want C-x C-v back to indentation M-m Formatting write buffer to a specified file C-x C-w toggle read-only status of buffer C-x C-q indent current line (mode-dependent) TAB Killing and Deleting indent region (mode-dependent) C-M-\ Getting Help entity to kill backward forward indent sexp (mode-dependent) C-M-q character (delete, not kill) DEL C-d indent region rigidly arg columns C-x TAB indent for comment M-; The help system is simple. Type C-h (or F1) and follow the di- word M-DEL M-d insert newline after point C-o rections. If you are a first-time user, type C-h t for a tutorial. line (to end of) M-0 C-k C-k sentence C-x DEL M-k move rest of line vertically down C-M-o remove help window C-x 1 sexp M-- C-M-k C-M-k delete blank lines around point C-x C-o scroll help window C-M-v join line with previous (with arg, next) M-^ kill region C-w delete all white space around point M-\ apropos: show commands matching a string C-h a copy region to kill ring M-w put exactly one space at point M-SPC describe the function a key runs C-h k kill through next occurrence of char M-z char describe a function C-h f fill paragraph M-q yank back last thing killed C-y get mode-specific information C-h m set fill column to arg C-x f replace last yank with previous kill M-y set prefix each line starts with C-x . Error Recovery Marking set face M-o Case Change abort partially typed or executing command C-g set mark here C-@ or C-SPC recover files lost by a system crash M-x recover-session exchange point and mark C-x C-x uppercase word M-u undo an unwanted change C-x u, C-_ or C-/ set mark arg words away M-@ lowercase word M-l restore a buffer to its original contents M-x revert-buffer mark paragraph M-h capitalize word M-c redraw garbaged screen C-l mark page C-x C-p uppercase region C-x C-u mark sexp C-M-@ lowercase region C-x C-l Incremental Search mark function C-M-h mark entire buffer C-x h The Minibuffer search forward C-s The following keys are defined in the minibuffer. search backward C-r Query Replace complete as much as possible TAB regular expression search C-M-s complete up to one word SPC interactively replace a text string M-% reverse regular expression search C-M-r complete and execute RET using regular expressions M-x query-replace-regexp show possible completions ? select previous search string M-p Valid responses in query-replace mode are select next later search string M-n fetch previous minibuffer input M-p exit incremental search RET replace this one, go on to next SPC or y fetch later minibuffer input or default M-n undo effect of last character DEL replace this one, don't move , regexp search backward through history M-r abort current search C-g skip to next without replacing DEL or n regexp search forward through history M-s replace all remaining matches ! abort command C-g Use C-s or C-r again to repeat the search in either direction. If back up to the previous match ^ Type C-x ESC ESC to edit and repeat the last command that Emacs is still searching, C-g cancels only the part not matched. exit query-replace RET used the minibuffer. Type F10 to activate menu bar items on c 2021 Free Software Foundation, Inc. Permissions on back. enter recursive edit (C-M-c to exit) C-r text terminals. GNU Emacs Reference Card Regular Expressions Registers any single character except a newline . (dot) save region in register C-x r s Buffers zero or more repeats * insert register contents into buffer C-x r i select another buffer C-x b one or more repeats + save value of point in register C-x r SPC list all buffers C-x C-b zero or one repeat ? jump to point saved in register C-x r j kill a buffer C-x k quote special characters \ quote regular expression special character c \c Transposing alternative (\or") \| Keyboard Macros grouping \( ::: \) transpose characters C-t shy grouping \(:? ::: \) start defining a keyboard macro C-x ( transpose words M-t explicit numbered grouping \(:NUM ::: \) end keyboard macro definition C-x ) transpose lines C-x C-t same text as nth group \n execute last-defined keyboard macro C-x e transpose sexps C-M-t at word break \b append to last keyboard macro C-u C-x ( not at word break \B Spelling Check name last keyboard macro M-x name-last-kbd-macro entity match start match end insert Lisp definition in buffer M-x insert-kbd-macro check spelling of current word M-$ line ^ $ check spelling of all words in region M-x ispell-region word \< \> check spelling of entire buffer M-x ispell-buffer symbol \_< \_> Commands Dealing with Emacs Lisp toggle on-the-fly spell checking M-x flyspell-mode buffer \` \' class of characters match these match others eval sexp before point C-x C-e Tags explicit set [ ::: ] [^ ::: ] eval current defun C-M-x word-syntax character \w \W eval region M-x eval-region find a tag (a definition) M-. character with syntax c \sc \Sc read and eval minibuffer M-: find next occurrence of tag C-u M-. character with category c \cc \Cc load a Lisp library from load-path M-x load-library specify a new tags file M-x visit-tags-table regexp search on all files in tags table M-x tags-search International Character Sets Simple Customization run query-replace on all the files M-x tags-query-replace specify principal language C-x RET l continue last tags search or query-replace M-, show all input methods M-x list-input-methods customize variables and faces M-x customize Shells enable or disable input method C-\ Making global key bindings in Emacs Lisp (example): set coding system for next command C-x RET c (global-set-key (kbd "C-c g") 'search-forward) execute a shell command M-! show all coding systems M-x list-coding-systems (global-set-key (kbd "M-#") 'query-replace-regexp) execute a shell command asynchronously M-& choose preferred coding system M-x prefer-coding-system run a shell command on the region M-| filter region through a shell command C-u M-| Info Writing Commands start a shell in window *shell* M-x shell enter the Info documentation reader C-h i (defun command-name (args) find specified function or variable in Info C-h S Rectangles "documentation" (interactive "template") Moving within a node: copy rectangle to register C-x r r body) scroll forward SPC kill rectangle C-x r k An example: scroll reverse DEL yank rectangle C-x r y beginning of node b (defun this-line-to-top-of-window (line) open rectangle, shifting text right C-x r o "Reposition current line to top of window. Moving between nodes: blank out rectangle C-x r c With prefix argument LINE, put point on LINE." prefix each line with a string C-x r t next node n (interactive "P") previous node p (recenter (if (null line) Abbrevs move up u 0 select menu item by name m (prefix-numeric-value line)))) add global abbrev C-x a g select nth menu item by number (1{9) n add mode-local abbrev C-x a l follow cross reference (return with l) f The interactive spec says how to read arguments interac- add global expansion for this abbrev C-x a i g return to last node you saw l tively.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us