Below is a collection of keyboard shortcuts for Spacemacs. As this is a cheat sheet, it will be updated over time to include new keyboard shortcuts and to maintain existing ones.

Basic Commands

  • SPC f f : open a file
  • SPC f s : save file
  • SPC f e d : open .spacemacs file
  • SPC b b : switch to file recently opened
  • SPC ' : open terminal in Emacs
  • SPC fed : open config file
  • SPC feR : reload config file

Searching

  • SPC s c : turn off previous highlighting
  • SPC s g p : grep text within files inside project

Org Mode

  • shift-TAB : overview of doc
  • <s-TAB : shortcut for inserting source code in org files
  • , ' : edit code block in macro editor
  • C-c ' : exit code block
  • , c : run code block
  • , s : schedule
  • , d : deadline
  • , e : open export menu
  • t : org-todo
  • SPC a o o : org-agenda
  • SPC a o t : org-agenda-todo-list
  • M-RET : insert new heading/item at current level
  • M-o : insert new heading/item at next level

Vim Mode

  • C-o : jump back
  • gc : comment/uncomment code (must be in visual mode)
  • SPC c l : comment/uncomment code
  • SPC x a r : align text by character
  • :-8,-6co. : copy relative line numbers -8 through -6 to where the cursor is at
  • c i w : “change inner word”; use instead of “change word”
  • d s " : delete surrounding double quote
  • c s " ' : change surrounding double quote to single quote
  • y s i w " : surround the inner words with double quotes
  • c s t <h2> : change surround tag to <h2>
  • SPC x t c : transpose two character
  • SPC x t l : transpose two lines
  • SPC x t w : transpose two words
  • cit : change text inside tags

Magit

  • SPC g s : magit-status
  • s : stage changes
  • c c : write commit message
  • :wq : save commit
  • p p : push commit
  • b b : checkout branch
  • b c : checkout new branch
  • b x : delete branch

Projectile

  • SPC p p : switch to project
  • SPC p f : find file in project
  • SPC p I : invalidate cache

JavaScript

  • , r e f : extract function
  • , r l t : adds console.log statement for what is a point

Elfeed

  • SPC a f : start elfeed
  • g r : update all the feeds
  • q : quit show window