This is a collection of key bindings useful for writing.
Cheat sheet with live links: spacemacs_cheat_sheet_1-2
Note that this cheat sheet is slightly out of date (for example, spare tree is now invoked with , s s) as of December 2018. I will update it soon.
See Spacemacs documentation for the full list of bindings. For more Org-mode keybindings see the Spacemacs Org Layer documentation.
Key bindings |
Action |
|
Capital C refers to the control (Ctrl) key. C-u = press Ctrl and u together. |
SPC f e d means press the space key, then f, then e, then d. RET means press the Enter/Return key. |
|
More at – |
||
SPC SPC |
to execute any interactive function (= M-x on emacs) |
|
i |
Switch to insert state |
|
esc |
Switch to normal state |
|
fd |
Alternative: press the f and d keys together |
|
also works for |
escape from all stock evil states to normal state |
|
escape from evil-iedit-state to normal state |
escape from evil-lisp-state to normal state |
|
abort isearch; quit magit buffers; quit help buffers |
abort evil ex command; quit minibuffer |
|
quit undo-tree buffer; quit paradox |
quit apropos buffers; quit ert buffers |
|
hide neotree buffer |
quit gist-list menu; quit helm-ag-edit |
|
|
If you find yourself in a buffer where Spacemacs (SPC) or Vim keybindings don’t work use this to get back to normal state (for example in “SPC SPC customize” press fd to make SPC b b work again). |
|
SPC t K |
toggle which-key mode (on by default) |
|
|
In which-key mode pressing Spc will bring up a buffer, after delay, with possible keys to follow Spc |
|
SPC ? |
Brings up a list of all keybindings allowing to search for specific key bindings by pressing any key that is part of a key binding or its description |
|
SPC q q |
quit |
|
SPC h SPC |
gives a number of help options |
|
SPC f e d |
open the dotspacemacs file to view or edit |
|
SPC f e R |
apply the changes made to the dotfile or layers without restarting Spacemacs |
|
|
search within a file |
|
|
|
|
SPC w s |
Split Windows |
|
SPC w / or SPC w v |
split window vertically |
|
SPC w – |
split window horizontally |
|
SPC 1 |
switch to window 1 |
|
SPC 2 |
switch to window 2 |
|
SPC w w |
Cycle between Windows |
|
SPC w d |
delete current window |
|
SPC TAB |
switch to previous buffer |
|
SPC b b |
switch buffers |
|
SPC b B |
list all buffers |
|
SPC t g |
Golden ratio mode |
|
SPC f f |
find a file |
|
SPC f s |
save a file |
|
SPC f r |
open a list of recently used files |
|
SPC f S |
save all open buffers |
|
SPC p p |
open project |
|
SPC p h |
find a file in current project |
|
SPC p t |
toggle a NerdTree at the project root |
|
SPC b d |
kill current buffer (does not delete file from drive) |
|
SPC b M |
move buffer to another window |
|
SPC v |
enter expand-region mode | |
SPC f f |
Open file |
|
SPC t |
list available toggles |
|
SPC ! touch new.org RET |
Create new blank org file | |
|
Note that SPC ! opens the command line – where you enter the command “touch” to create a new file: “new.org” – of course it |
|
C-/ |
Undo |
|
C-? |
Redo |
|
SPC n f |
Narrow to function (or paragraph) |
|
SPC n w |
to exit Narrow |
|
SPC SPC toggle-frame-fullscreen |
Full screen |
|
SPC SPC occur RET ^*+ RET |
Open navigation pane for org file |
|
This is a very useful command |
move window to the right |
|
SPC j |
for all jump commands |
|
SPC P / |
start pandoc-mode and open menu |
|
GUI Toggles |
|
|
SPC T M |
toggle frame maximize |
|
SPC T t |
toggle tool bar |
|
SPC t n |
toggle line numbers |
|
Useful Vim key bindings |
Movement |
|
0 |
beginning of line |
|
$ |
end of line |
|
9 j |
move down 9 lines |
|
W |
move ahead word |
|
B |
move back word |
|
g g |
first line | |
G | last line | |
C-u | up half page | |
C-d | down half page | |
f / | move forward to first “/” character | |
; | repeat that command again | |
H |
head of the screen | |
M |
middle of screen | |
L | last of the screen | |
} | move forward by paragraph or block | |
{ | move backwards by paragraph or block | |
* | search for word under the cursor | |
n |
search again forward | |
N | search again backwards | |
# | search backwards for word under cursor | |
/ | search forward | |
? | search backward | |
% | find matching brace, paren, etc | |
m a | mark a line in a file with marker “a” | |
` a |
after moving around, go back to the exact position of marker “a” |
|
‘ a | after moving, go back to line of marker “a” | |
: marks RET | view all the marks | |
‘ ‘ | go to the last mark you were at | |
Editing |
|
|
x |
delete char under cursor |
|
X |
delete char before cursor |
|
A |
add to end of line |
|
I |
insert at the beginning of the line |
|
d d |
delete line |
|
D |
delete from cursor to end of line |
|
d i ‘ |
delete text inside single quotes |
|
y y |
copy line |
|
Y |
copy from cursor to end of line |
|
c c |
change line |
|
C |
change |
|
c i t |
change text inside html tag |
|
c i ‘ |
change text inside single quotes |
|
c i { |
change text inside curly brackets. |
|
c i … |
.. square brackets etc. |
|
p |
paste after cursor |
|
P |
paste before cursor |
|
o |
add line below |
|
O |
add line above |
|
r |
replace character |
|
R |
replace. (overwrite) (good for columns of text) |
|
J |
join line (cursor can be anywhere on line) |
License
Copyright © 2016 Christopher J Poor. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Code in this document is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This document and its code are distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details <http://www.gnu.org/licenses/>.