Skip to content

Instantly share code, notes, and snippets.

@cairesr
Last active April 28, 2024 02:14
Show Gist options
  • Save cairesr/881f607e9f8e5de9336a41be63dc61bf to your computer and use it in GitHub Desktop.
Save cairesr/881f607e9f8e5de9336a41be63dc61bf to your computer and use it in GitHub Desktop.
Emacs Cheat Sheet for macOS

Basics

ctrl + g - quit any Emacs command

crtl-x b - new buffer

crtl-x k - kill buffer

ctrl-x Ctrl-f - find / create new file na ctrl-x Ctrl-s - save file

Text Edit

ctrl+k - kill everything from the pointer to the end of the line (shortcut to kill-line command)

ctrl+/ - undo command

ctrl+a - go to the beginning of the line

ctrl+e - go to the end of the line

alt+f - move forward one word

alt+b - move backward one word

ctrl+s - regex search

alt+shift+< - go to the beginnig of the buffer

alt+shift+> - go to the end of the buffer

alt+g g - go to line

Run commands

opt-x - prompt for command (shortcut to smex command)

Mode Management

opt-x package-list-package - list packages

opt-x package-refresh-contents - refresh packages

opt-x package-install - install package

Cider

alt+x cider-jack-in starts the REPL

alt-x package-install then cider

ctrl-x o switch the cursor to the other window

ctrl-x 0 delete current window

ctrl-x 1 delete all other windows

ctrl-x 2 split frame above and below

ctrl-x 3 split frame side by side

ctrl-x ctrl-e runs cider-eval-last-expression

ctrl-c alt-n sets the namespace at the top of the file

ctrl+x ctrl+k compiles the current file within the REPL

ctrl+↑ or ctrl+↓ navigates through REPL commands history

ctrl+c ctrl+d ctrl+d displays documentation for the symbol under point

ctrl+c ctrl+d ctrl+a searches for text across functions and documentation

alt-. navigate to source code of symbol under point

alt-, go back to your current buffer

ctrl+alt+f ctrl+alt+b move to the opening/closing parenthesis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment