# emacs [Wikipedia](https://en.wikipedia.org/wiki/Emacs) ( Type: Software ) ## Description Extensive personal Emacs keybinding and workflow cheatsheet — file/buffer/window management, Dired, Org mode, Magit, and package management. ## Key Tags #emacs #keybindings ## Essential Works - [GNU Emacs Manual](https://www.gnu.org/software/emacs/manual/html_node/emacs/index.html) - official reference manual ## Details %% none yet %% ### Concepts and Theories %% none yet %% ### Related Practices - [[LLMs and Assistive Code Models]] - alternate/complementary text-editor environment used alongside Emacs ### Key Practitioners %% none yet %% ### Institutional Affiliations %% none yet %% ### Notes [[wtkns/Subject Notes/emacs]] - [[file:latex.org][LaTeX Cheatsheet]] - Negative argument: Meta Dash or M-(-) - Links: - www.gnu.org/software/emacs/manual/html_node/emacs/index.html - planet.emacsen.org - emacsrocks.com/ - Help: - Help for Help | C-h C-h - Manual | C-h r - Describe Variable | C-h v - Describe Function | C-h f - Describe Key | C-h k - Search Documentation | C-h d - List Keybindings | C-h b - Info Mode - Back or Forward | [ or ] - History | l - Up | ^ - Commands: - Abort a command | C-g - Quit emacs | C-x C-c - Undo | C-_ - or- | C-x u - Repeat a command | C-U #n <Command> - or- | M-#n <Command> - Open Command Bar | M-` - Evaluate (execute) a SEXP | C-x C-e - Files: - Edit (new) file | C-x C-f - load-file | C-c C-l - Open Recent File | C-x C-r - open File under Point | C-x C-p - Save File | C-x C-s - Save All Files | C-x s - find file other Window | C-x 4 f - find file other Frame | C-x 5 f - Dired | C-x d - Open File | RET - Close File/Directory | q - Go to parent | ^ - Copy File | C - Rename File | R - Delete File | D - Delete marked files | x - Make Directory | + - Compress File | Z - Mark multiple files | m - Unmark Files | u - Unmark all marked | U - Refresh listing | g - Hide details | ( - Show Details | ) - Ansi-term - Line Mode | C-c C-j - char mode | C-c C-k - Buffers: - buffer-menu | C-Tab - or - | C-x C-b - Quit | q - Open in this window | Ret - Open in Other Window | o - Full frame window | 1 - Open Marked Buffers | v - Sort Buffers by Point | S - Unmark | U - Flag for: - Display | m - killing | d - Saving | s - Read/write Status | % - Kill Buffer | C-x k - Write Buffer | C-x C-w - Switch buffer | C-x b - List Buffers | C-x C-b - insert a file | C-x i - into this buffer - Replace this file | C-x C-v - Movement: - Scroll point to center | C-l - Goto line | M-g g - Goto Search (i-search) | C-s - Next instance | C-s - Previous Instance | C-r - Back to indent | M-m - | Back | Forward - - Character | C-b | C-f - Word | M-b | M-f - Line | C-p | C-n - Screen | M-v | C-v - End of Line | C-a | C-e - Sentence | M-a | M-e - Paragraph | M-{ | M-} - Page | C-x [ | C-x ] - Buffer | M-< | M-> - First non WS | M-m - go to line | M-g g - Regions: - ---------------------------------- - Set Mark | C-SPC - Mark Paragraph | M-h - Mark Entire Buffer | C-x h - Exchange Point and Mark | C-x C-x - Comment Region | C-x C-; - Indent Region | C-u n CM-\ - (n spaces) - Killing (Cutting): - (Kill Ring = KR) - ---------------------------------- - Kill region | C-w - Copy region | M-w - Kill Word | M-DEL - (append to last KR entry) - Kill to EOL | C-k - (append to last KR entry) - Kill to BOL | C-0 C-k - (append to last KR entry) - Yanking (pasting) - ----------------------------------- - Yank last from KR | C-y - Yank Pop | M-y - Paste from OSX Clipboard| Alt-V - Other editing - ----------------------------------- - Transpose Characters | C-t - Transpose Words | M-t - Transpose Lines | C-x C-t - Capitalize Character | M-c - Lowercase Character | M-l - Uppercase Word | M-u - Apply to start of word | M-(-) - Windows: - ----------------------------------- - Split Vertically | C-x 2 - (vertically stacked) - Split Horizontally | C-x 3 - (Side by Side) - Kill Window | C-x 0 - Solo Window | C-x 1 - Undo window change | C-c Left - Window Navigation - ----------------------------------- - Switch Window | C-x o - M-Arrow - enlarge-window (vert) | SC-Up - shrink-window | SC-Down - enlarge-window-horizontally | SC-Right - shrink-window-horizontally | SC-Left - Frames - ----------------------------------- - Open a new frame | s-n - Bookmarks: - ----------------------------------- - set bookmark | C-x r m - jump to a bookmark | C-x r b - list your bookmarks | C-x r l - delete a bookmark | M-x bookmark-delete - Bookmark List - -------------------------------- - show annotation | a - show all annotations | A - mark for deletion | d - edit annotation | e - mark for display | m - visit in other window | o - Switch to bookmark | C-o - Rename bookmark | r - Commit changes | x - Modes - ----------------------------------- - IRC | M-x irc - /join #emacs - Magit - ----------------------------------- - http://magit.github.io/master/magit.html - Magit-status | C-c g - Switch Re - po | C-u C-c g - Add Repo | add-to-list - 'magit-repo-dirs - Refresh buffer | g - Add to staging | s - Add to ignore | i - delete untracked file | k - Commit | c <comment> C-c C-c - Stage all | C-u S - Ignore by name | C-u i - Show repository history | l l - Verbose history | l L - Branches popup | b - Branch Manager | b v - Create branch & switch | b c - Push | P P - fetch | f f - pull | F F - Outline Mode - ----------------------------------- - Next Heading | C-c C-n - Previous Heading | C-c C-p - Next Heading of same level | C-c C-f - Previous Heading of same level | C-c C-b - hide current entry | C-c C-c - Show current entry | C-c C-e - hide subtree | C-c C-d - Show subtree | C-c C-s - Show Branches | C-c C-k - Show Children | C-c C-i - Show Only Current Entry | C-c C-o - Show All | C-c C-a - Hide all but N Sublevels (1) | C-c C-q N - Org Mode [[help:org-mode][main org keybindings]] - See also: http://orgmode.org/orgcard.txt - |----------------------------------+-------------| - | new entry | M-Ret | - | Demote/Promote new entry | <tab> | - | New ToDo | C-S-<ret) | - | Promote Entry | M-<RIGHT> | - | Demote Entry | M-<LEFT> | - | Cycle single entry visibility | <TAB> | - | Cycle all entry Visibility | S-<TAB> | - | Move Entry Up | M-<UP> | - | Move Entry Down | M-<DOWN> | - | Turn Item into headline | C-c * | - | Turn Headline into item (cycle) | C-c - | - | Mark ToDo | C-c C-t | - | customize with org-todo-keywords | | - | Mark Scheduled | C-c C-s | - | Mark Deadline | | - | org-cut-subtree | C-c C-x C-w | - | org-copy-subtree | C-c C-x M-w | - | org-paste-subtree | C-c C-x C-y | - | Overlay time stamps | C-c C-x C-t | - |----------------------------------+-------------| - |----------------+------------------------| - | Minor Modes | | - |----------------+------------------------| - | Refill Mode | M-x refill-mode | - | Autofill Mode | M-x auto-fill-mode | - | Overwrite Mode | M-x overwrite-mode | - | -or- | M-x ov | - | Save desktop | M-x desktop-save | - | (Manually) | | - | Change Desktop | M-x desktop-change-dir | - | Return to prev | M-x desktop-revert | - |----------------+------------------------| - Packages - ----------------------------------- - M-x Package-List-Packages - Mark for Installation | I - Install marked packages | x - W3m - ----------------------------------- - w3m-goto-url | C-x w - (Must use http:// in address) - Calendar - ----------------------------------- - m mark diary entries | m - d view diary entries | d - s show all diary entries | s - id insert diary entry | id - iw insert weekly diary entry | iw - im insert monthly diary entry | im - Journal - ----------------------------------- - New Journal Entry | C-c j - insert new journal at date | i j - go to journal at date | j - Next/previous Entry | [ or ] - Clocking in | C-c C-x C-i - (org-clock-in) | - Clocking out | C-c C-x C-o - (org-clock-out) | - Select Task first | C-u C-c C-x C-i - Clocking into last | C-c C-x C-x - (org-clock-in-last) - Jump to curr task | C-c C-x C-j - (org-clock-goto) - Clock Display | C-c C-x C-d - Deft - ----------------------------------- - Open Deft Mode | C-c d - or | - Toggle Deft Mode | f8 - New File | C-c C-n - Rename File | C-c C-r - Quit Deft | C-c C-q - Archive a file | C-c C-a - (move to ~/notes/archive) - Org Mode footnotes - ----------------------------------- - Frames - ----------------------------------- - New frame | s-n - Close frame | s-w - Unicode Characters: - ----------------------------------- - insert unicode: M-x insert-char or <C-x 8> Ret - then: name or Hexadecimal value - | Char | Name | Hex code | - |------+-----------------+----------| - | λ | lambda | 3bb | - | π | pi | 03c0 | - | ≅ | Approx equal to | 2245 | ## References ### Primary Sources Bibliography %% none yet %% ### Secondary Sources Bibliography %% none yet %%