liuchengxu / space-vim

:four_leaf_clover: Lean & mean spacemacs-ish Vim distribution
https://liuchengxu.github.io/space-vim/
MIT License
2.86k stars 255 forks source link

How to add new bindings under leader key? #406

Closed c02y closed 5 years ago

c02y commented 5 years ago

Before you continue, ensure you have read the README and wiki carefully. Note that low quality issue feedback might be closed directly.

Environment

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

Put the contents of :version below:

Problem Description

  1. How to add new bindings under leader key, for instance, I want to add a new binding such as <Leader> t t to toggle line number.(If such binding exists, please ignore me, it is just an example)

  2. I can know how to add new prefix and bindings under it after reading core/autoload/spacevim/map/leader.vim, but a documentation should be created.

c02y commented 5 years ago

OK, I got it after reading layers/+distributions/better-defaults/keybindings.vim file.

Just like usual way in vimrc:

  nnoremap <Leader>tt :call NumberToggle()<cr> " NumberToggle() is just a function

But it should be mentioned somewhere along with adding new prefix and bindings under Leader like core/autoload/spacevim/map/leader.vim

liuchengxu commented 5 years ago

To he honest, I now don't have too much time for this project, which just works perfectly for me. If you are willing to help, you could contribute to the help https://github.com/liuchengxu/space-vim/blob/cd5c20198528058bf93332750711ccfa7793a7a4/core/doc/spacevim.txt .