Spacemacs Tutorial
I’m learning Spacemacs (with Vim key bindings (check out this blog post by Stéphane Caron)) and would like to share some of my notes here.
For detailed instructions and a deeper understanding please refer to Spacemacs’ official documentation.
Modal editing with Vim

ESC Key returns you from other modes to the normal mode.
You can learn Vim key bindings with (SPACE h T v), the Emacs Evil Tutor :-p.
Of course there are many other wonderful and interactive tutorials out there…
Navigation in NORMAL mode

word-level
wforward motion by wordbbackward motion by wordeforward motion by end of word
line-level
0the beginning of line$end of line^first non-empty character of the line
buffer-level
(Ctrl U)scrolls up(Ctrl D)scrolls downggbeginning of bufferGend of buffer
moving the cursor
Hto the highest line of the screenMto the middle line of the screenLto the lowest line of the screen
find f|F
ffind in forward directionFfind in backward direction
1 | fo |
to t|T (a variant of find)

Editing Commands
Open
oopens a line below and entersINSERTmode.Oopens a line above and entersINSERTmode.
Delete
Deletion combines with movement commands.
dwdeletes a worddedeletes from cursor position to end of the worddddeletes the linexdeletes a single character at cursor position (like on a typewriter!)
Change
Change combines with movement commands. Think of it as delete and enter into INSERT mode.
cwchanges the word, i.e. deletes the word and puts you inINSERTmode.cedeletes the word from cursor position to end of the word and entersINSERTmode.ccdeletes the line and entersINSERTmode.
Replace
rreplaces single character at cursor position, after replacement inNORMALmode.Renters and remains inREPLACEmode until you switch mode.
Undo and Redo
uto undo changes.Ctrl rto redo.
Copy and Paste
y for Yank and p for Paste
These two also combines with movement commands.
yycopies current line.ywcopies the word.ppastes at cursor position.
If you want to move a line, you can use
ddto delete the line and thenpto paste it wherever you want.
--VISUAL-- for text selection
To select blocks of text we use VISUAL mode and navigate to make a selection.
Then we can use y for copying the selection and automatically returns to NORMAL mode.
--VISUAL LINE--selects by lines--VISUAL BLOCK--selects by rectangular blocks of text
1 | `~` flips the case of selected text. |
Counts
We can use numbers for quick and specific movements.
For instance, <number>j = pressing j <number> times.
Therefore:
4kmoves cursor up 4 linesv3eentersVISUALmode, select 3 words (select to the end of the third word).d7wor7dwdeletes 7 words counting from the word the cursor is at.
Since counts are so useful, there’s a trick that facilitates the use of line numbers. Instead of counting or mentally subtracting line numbers, we can use relative line numbers!
Relative Line Numbers

Setting up relative line numbers
In .spacemacs, set dotspacemacs-line-numbers 'relative.
Modifiers
a for Around and i for Inside
ci[changes (deletes) everything inside square brackets, enterINSERTmode.di(deletes everything inside parentheses, remains inNORMALmode.da(deletes also the parentheses around, remains inNORMALmode.
Miscellaneous
Matching Parenthesis
If you have your cursor on one of them, % will show you its match.
Case Flip
~ flips the case of selected text.
The lazy dot .
. simply repeats the previous editing command that Vim made.
The dotspacemacs file
.spacemacs is Spacemacs’ configuration file.
The dotfile is written in emacs-lisp language, ;; is used for comments.
Most used commands related to the dotfile:
(SPACE f e)shortcut combo opens a list of commands.d-> opens the dotfileR-> reloads configuration
Usually the most important section of the dotfile is under dotspacemacs-configuration-layers.
Spacemacs GUI - Spaceline
Spaceline is spacemacs’ powerline.

The number displayed on the left corner is the window number.
Other information on the line:
- status of the file
*shows that the file has been modified but the changes are not saved.
- size of the file
- filename
- the current major mode
Emacs-Lisp,Org,Markdownetc.- In
Emacs-Lispmajor mode, use(SPACE c L)to toggle comments.
- In
- On the right of the powerline: cursor position
<line>:<character> <percentage through the file>
Under the spaceline there’s usually an indication of the current editing mode, in the above example it is the INSERT mode.
Bits and pieces
Save Buffer
Using the familiar commandline mode (led by the : key):
:wwrites buffer to file.:q!quits without saving any changes.:qquits (current window).:qaquits all windows.
A more Spacemacs-way of saving the buffer is (SPACE f s).
Font
Setting default font and font size
- Search through the dotfile using vim syntax:
/font. - Modify
dotspacemacs-default-font. - Save the dotfile and restart emacs.
Zoom-in and -out
(SPACE z f) enters zoom frame transient state. Type q to quit.
Toggle line wrap
(SPACE t l) toggles line wrap.




