C-x hold Ctrl down and press x M-x hold Meta (Alt) down and press x or press Esc then press x Files: Open file (find-file) Files/Open File... C-x C-f Save file (save-buffer) Files/Save Buffer C-x C-s Exit emacs (save-buffers-kill-emacs) Files/Exit Emacs C-x C-c Moving about: cursor (by one char) left,up,right,down C-b, C-p, C-f, C-n (back, previous, forward, next) cursor (by one word) M-left, M-right M-b, M-f scroll page PgUp, PgDown C-v, M-v start and end of document Home, End M-<, M-> start and end of line C-a, C-e goto-line M-x goto-line LINE Marks and registers set-mark-command C- exchange-point-and-mark C-x C-x showing mark region Help -> Options -> Transient Mark Mode go back to a mark C-u C- returns to a mark stored in the mark ring point-to-register C-x r R save position in register R (could be also any other name) jump-to-register C-x r j R jump to the position in register R Repeating commands numeric arguments hold down Meta, and type in the number or and type in the number or C-u and type in the numbers just C-u "multiply by four" C-u C-u C-f moves forward sixteen chars Undo undo C-/ or C- or C-x u a regular undo redo after you undo, do anything else (e.g., move cursor) and then previous undo's are valid edits that can be undone (redone) region undo C-u C-/ or C-u C- or C-u C-x u mark a region, then prepend undo with C-u, and the undo only happens within the region keyboard-quit C-g quit the execution of a command this is what you hit when you get messed up... Copy-paste-cut-delete... kill-line C-k kills line until EOL, if want that too hit C-k again yank C-y Reinserts the last stretch of killed text yank-pop M-y Replace just-yanked kill with a different one from kill ring clipboard-yank Edit/Paste kill-region C-w Kill between point and mark (save in the kill ring) kill-ring-save M-w Save the region in the kill ring but don't kill delete-char C-d Kill the following N characters kill-word M-d Kills characters forward until end of a word (N times) delete-backward-char DEL Kill the previous N characters backward-kill-word M-DEL Kills characters backward until end of a word (N times) Note: single character kills don't got to the kill buffer, multi character kills do Do it in blocks: clear-rectangle C-x r c Blank out marked rectangle kill-rectangle C-x r k yank-rectangle C-x r y Finding help describe-key C-h k KEY try: C-h k M-v info C-h i contains among other things the emacs manual apropos-command C-h a APROPOS-REGEXP try: C-h a tags move cursor to the line list-tags, hit enter describe-function C-h f FUN try: C-h f desc fu try: C-h f info Search and replace isearch-forward C-s incremental search forward isearch-backward C-r the same backward More info about search: C-h k C-s e.g.: repeat the same search by hitting C-s (forward) or C-r (backward) C-w, C-y, M-y to yank stuff to the search string M-n (next) and M-p (prev) item in search string Try info command: C-h i info command scroll down to line with boldface Emacs, hit enter a topic with C-s search search for search, enter C-s incr C-s C-s incrementally search for incr, the third time's the charm read about incremental search n next topic is about nonincremental search u go back up to general info about search query-replace M-% query-replace FROM-STRING TO-STRING you have to tell what to do with each match, instructions by hitting C-h, e.g., y replace n skip q,RET exit ! replace all matches and others... Buffers: Buffers/List All Buffers C-x C-b switch-to-buffer C-x b kill-buffer C-x k Windows: other-window C-x o delete-window C-x 0 delete-other-windows C-x 1 split-window-vertically C-x 2 split-window-horizontally C-x 3 make window narrower/wider/taller C-x {, C-x }, C-x ^ Macros start-kbd-macro C-x ( end-kbd-macro C-x ) call-last-kbd-macro C-x e Programming help comment-region M-x comment-region comment out the marked region uncomment region C-u M-x comment-region uncomment the marked region vc-toggle-read-only C-x C-q If the file is under CVS, check the file in (commit). Otherwise, just change the read-only flag of the buffer. With a prefix arg, ask for the version number. compile M-x compile COMMAND Runs COMMAND (default make) in a separate process, output goes to buffer *compilation* grep M-x grep COMMAND-ARGS Runs grep and collects output in a buffer next-error C-x ` or M-x next-error go to the next compilation error or the next grep hit Python-mode specific py-comment-region C-c # comment out the marked region with ## uncomment py-comment C-u C-c # uncomment ## py-shift-region-left C-c < shift the region left by py-indent-offset columns py-shift-region-right C-c > shift the region right by py-indent-offset columns py-execute-region C-c | py-shell C-c ! py-beginning-of-def-or-class M-C-a py-end-of-def-or-class M-C-e Variables describe variable C-h v VAR e.g., C-h v py-indent-offset change variable M-x set-variable VAR VALUE > e.g., M-x set-variable py-indent-offset 4 Dired dired C-x d DIRNAME Edit directory DIRNAME (delete, rename, ...) h to get info on dired + create a new directory RET find current line's file or dired a dir s toggle sorting by name/date d mark for deletion DEL unmark for deletion x execute deletions g update buffer ...