Skip to content

Instantly share code, notes, and snippets.

@martijnvermaat
Last active November 14, 2016 18:08
Show Gist options
  • Save martijnvermaat/552ffb313d62f9be8e14 to your computer and use it in GitHub Desktop.
Save martijnvermaat/552ffb313d62f9be8e14 to your computer and use it in GitHub Desktop.
Emacs notes

Emacs notes

Just some Emacs things that I cannot seem to remember without writing them down. I'm an Emacs newbie (but have been using it for 15 years).

These are random and specific to my setup, so probably not useful to anyone else.

Config can be found here: https://github.com/martijnvermaat/dotfiles

Files, buffers, and windows

  • C-x C-f Find file.
  • C-x C-s Save buffer.
  • C-x s Query to save all buffers.
  • C-x k Delete buffer.
  • C-x b Switch buffer.
  • C-x o Go to next window.
  • C-x 0 Delete current window.
  • C-x 1 Delete other window.
  • C-x 2 Split window vertically.
  • C-x 3 Split window horizontally.

Magit

  • C-x g Magit status.
  • C-x M-g Magit dispatch popup.

Ido

Interactively do things with buffers and files. http://emacswiki.org/emacs/InteractivelyDoThings

  • C-f Fall back to find-file without Ido.
  • C-b Fall back to switch-buffer without Ido.
  • C-a Toggle showing ignored files.

Smex

A smart M-x enhancement for Emacs built on Ido. https://github.com/nonsequitur/smex

  • C-h f Run describe-function on the selected command.
  • C-h w Show the key bindings for the selected command.

undo-tree

Treat undo history as a tree. http://www.dr-qubit.org/emacs.php

  • C-x u Visualize the undo tree.
  • d Toggle diff display.
  • q Quit the tree visualizer.

neotree

  • <F8> Toggle neotree.
  • H Toggle display hidden files.

Jedi

Python auto-completion for Emacs. https://github.com/tkf/emacs-jedi

  • C-c ? Show the documentation of the object at point.
  • C-c . Goto the definition of the object at point.
  • C-c , Goto the last point where C-c . was called.

Tern

A JavaScript code analyzer for deep, cross-editor language support. https://github.com/marijnh/tern

  • M-. Jump to the definition of the thing under the cursor.
  • M-, Brings you back to last place you were when you pressed M-..
  • C-c C-c Find the type of the thing under the cursor.
  • C-c C-d Find docs of the thing under the cursor. Press again to open the associated URL (if any).

Keyboard macros

  • C-x ( Start defining macro.
  • C-x ) Stop defining macro.
  • C-x e Execute macro (C-u prefixed to execute any number of times).
  • C-x C-k C-i Insert macro counter (C-u prefixed for increment other than 1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment