Basics C-h b see ALL bound keys C-x C-f "find" file i.e. open/create a file in bufferC-x C-s save the fileC-x C-w write the text to an alternate nameC-x C-v find alternate fileC-x i insert file at cursor positionC-x b create/switch buffersC-x C-b show buffer listC-x k kill bufferC-z suspend emacs C-X C-c close down emacsC-M-/ complete function or path
Basic movement C-f forward charC-b backward charC-p previous lineC-n next lineM-f forward one wordM-b backward one wordC-a beginning of lineC-e end of lineC-v one page upM-v scroll down one pageM-< beginning of textM-> end of textC-Shift-% -> find and replaceFind and replace in multiple files Editing M-n repeat the following command n timesC-u repeat the following command 4 timesC-u n repeat n timesC-d delete a charM-d delete wordM-Del delete word backwardsC-k kill line⌘-k copy line (custom function) C-\ kill horizontal whitespaceC-Space Set beginning mark (for region marking for example)C-W "kill" (delete) the marked region regionM-W copy the marked regionC-y "yank" (paste) the copied/killed region/lineM-y yank earlier text (cycle through kill buffer)C-x C-x exchange cursor and markC-t transpose two charsM-t transpose two wordsC-x C-t transpose linesM-u make letters uppercase in word from cursor position to endM-c simply make first letter in word uppercaseM-l opposite to M-uOnline-Help C-h c which command does this keystroke invokeC-h k which command does this keystroke invoke and what does it do?C-h l what were my last 100 typed keysC-h w what key-combo does this command have?C-h f what does this function doC-h v what's this variable and what is it's valueC-h b show all keycommands for this bufferC-h t start the emacs tutorialC-h i start the info readerC-h C-k start up info reader and go to a certain key-combo pointC-h F show the emacs FAQC-h p show infos about the Elisp package on this machine | Important C-g quit the running/entered commandM-/ fill complete typing
C-x u undo previous actionM-x revert-buffer RETURN (insert like this) undo all changes since last saveM-x recover-file RETURN Recover text from an autosave-fileM-x recover-session RETURN if you edited several filesM-x r-mode RETURN to change the current file to R modeWindow Commands
C-x 2 split window verticallyC-x o change to other windowC-x 0 delete windowC-x 1 close all windows except the one the cursors inC-x ^ enlarge windowM-x shrink-window command says it ;-)M C-v scroll other windowC-x 4 f find file in other windowC-x 4 o change to other windowC-x 4 0 kill buffer and windowC-x 5 2 make new frameC-x 5 f find file in other frameC-x 5 o change to other frameC-x 5 0 close this frameLatex Commands C-c C-e Insert EnvironmentC-c C-f C-e/b/i Emphasis/Bold/ItalicC-' Comment/Uncomment selectionC-x r m set a bookmark at current cursor posC-x r b jump to bookmarkM-x bookmark-rename says itM-x bookmark-delete "M-x bookmark-save "C-x r l list bookmarks
M-x bookmark-write write all bookmarks in given fileM-x bookmark-load load bookmark from given fileShell M-x shell starts shell modusC-c C-c same as C-c under unix (stop running job)C-d delete char forwardC-c C-d Send EOFC-c C-z suspend job (C-z under unix)M-p show previous commandsDIRectory EDitor (dired) C-x d start up diredC (large C) copy d mark for eraseD delete right awaye or f open file or directoryg reread directory structure from fileG change group permissions (chgrp)k delete line from listing on screen (don't actually delete)m mark with *n move to next lineo open file in other window and go thereC-o open file in other window but don't change thereP print fileq quit diredQ do query-replace in marked filesR rename fileu remove markv view file contentx delete files marked with Dz compress fileM-Del remove all marks (whatever kind)~ mark backup files (name~ files) for deletion# mark auto-save files (#name#) for deletion*/ mark directory with * (C-u * removes that mark again)= compare this file with marked fileM-= compare this file with it's backup file! apply shell command to this fileM-} change to the next file marked with * od DM-{ " previous "% d mark files described through regular expression for deletion% m " (with *)+ create directory> changed to next dir< change to previous dirs toggle between sorting by name or dateMaybe into this category also fits this command: M-x speedbar starts up a separate window with a directory view | Search/Replace C-s Search forwardC-r search backwardC-g return to where search started (if you are still in search mode)M-% query replaceSearch/Replace with regular expressions Characters to use in regular expressions: ^ beginning of line$ end of line. single char.* group or null of chars\< beginning of a word\> end of a word[] every char inside the backets (for example [a-z] means every small letter)M C-s RETURN search for regular expression forwardM C-r RETURN search for regular expression backwardM C-s incremental searchC-s repeat incremental searchM C-r incremental search backwardsC-r repeat backwardsM-x query-replace-regexp search and replaceProgramming M C-\ indent region between cursor and markM-m move to first (non-space) char in this lineM-^ attach this line to previousM-; formatize and indent commentText Works only in text mode M-s center lineM-S center paragraphM-x center-region name says Macro-commands C-x ( start macro definitionC-x ) end of macro definitionC-x e execute last definied macroM-n C-x e execute last defined macro n timesM-x name-last-kbd-macro give name to macro (for saving)M-x insert-keyboard-macro save named macro into fileM-x load-file load macroM-x macroname execute macroname |
