Skip to content

Instantly share code, notes, and snippets.

@jrusev
Last active January 19, 2016 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrusev/dfb322ce3f19ba9b8892 to your computer and use it in GitHub Desktop.
Save jrusev/dfb322ce3f19ba9b8892 to your computer and use it in GitHub Desktop.
Useful commands for working with Clojure in Emacs

Emacs

http://www.shortcutworld.com/en/linux/Emacs_23.2.1.html

Command Description
C-x b Switch buffer.
C-/ Undo.
C-s Search forward.
C-r Search backward.
M-x rgrep Search in files.
C-v PageDown.
M-v PageUp.
Shift-→ Move point from window to window using Shift and the arrow keys (like C-x o), see WindMove.
C-x h Select entire buffer
C-w Cut
M-w Copy
C-y Paste
C-x s Save
M-b Back one word
M-f Foward one word
C-a Beginning of line
C-e End of line
C-n Next line
C-p Previous line
M-< Beginning of buffer
M-> End of buffer
C-x C-f Find file
C-x b Switch buffer
C-x k Kill buffer
C-x 2 Split-window-vertically
C-x 3 Split-window-horizontally
C-x o Switch window
C-x 0 Kill this window
C-x 1 Kill all other windows
M-; Insert or realign comment on current line; if the region is active, comment or uncomment the region instead
C-M-\ M-x indent-region
C-/ Undo

Cider

Command Description
C-c M-n Switch the namespace of the REPL buffer to the namespace of the current buffer.
C-c C-e Evaluate the form preceding point and display the result in the echo area. If invoked with a prefix argument, insert the result into the current buffer.
C-c M-o Clear the entire REPL buffer, leaving only a prompt.
C-c C-k Load (eval) the current buffer.
C-c , Run tests for namespace.

Projectile

Command Description
C-c p f Display a list of all files in the project. With a prefix argument it will clear the cache first.
C-c p d Display a list of all directories in the project. With a prefix argument it will clear the cache first.
C-c p s g Run grep on the files in the project.

expand-region

Command Description
C-= Increases the selected region by semantic units. Just keep pressing the key until it selects what you want.

multiple-cursors

Command Description
C-> Add multiple cursors forward.
C-< Add multiple cursors backward.
C-c C-< Marks all parts of the buffer that matches the current region.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment