Your browser does not support JavaScript!
Upvotes Anonymous 11 User 0

How to create a keyboard shortcut in Spacemacs

Let's jump into an example. If I want to pull up NeoTree every time I press SPACE o t, I add this to my .spacemacs user config:
(spacemacs/set-leader-keys "ot" 'neotree-toggle)
I then restart Spacemacs. I can now press SPACE o t:
and NeoTree appears:
So to add a shortcut, we find the name of the elisp function we'd like to call (e.g. neotree-toggle), and add a line to our .spacemacs file.
Will this shortcut override other shortcuts?
Was this helpful?

Tags

Comments

Leave a Comment

I agree to the Terms of Service
Design © 2015, Downranked, LLC.,
Original user code contributions under MIT License