Spacevim: How should I set leader in init.toml

Created on 19 Jun 2018  路  4Comments  路  Source: SpaceVim/SpaceVim

Hi,
I want to set leader in init.toml, this is my config:
~/.SpaceVim.d/init.toml

[options]
bootstrap_after = "config#after"                                                                                 
bootstrap_before = "config#before"

~/.SpaceVim.d/autoload/config.vim

func! config#before() abort                                                                                              
  let mapleader=','                                                                                                      
endf                                                                                                                     

func! config#after() abort                                                                                               
  let mapleader=','                                                                                                                                                                                                
endf              

But it isn't work, how should I do?

usage

Most helpful comment

the doc of mapleader is not very clear, it should tell user to use g:mapleader instead, I think this is a type of vim's help file.

so your function should be

func! config#before() abort
   let g:mapleader  = ','
   " after this line, when you using <leader> to defind key bindings
   " the leader is ,
   " for example:
   nnoremap <leader>w :w<cr>
   " this mapping means using `,w` to save current file.
endf

All 4 comments

the doc of mapleader is not very clear, it should tell user to use g:mapleader instead, I think this is a type of vim's help file.

so your function should be

func! config#before() abort
   let g:mapleader  = ','
   " after this line, when you using <leader> to defind key bindings
   " the leader is ,
   " for example:
   nnoremap <leader>w :w<cr>
   " this mapping means using `,w` to save current file.
endf

Finally I found the right solution! You won't know how hard I got here. It would really be nice to make it more clear in the doc how to set the mapleader simply because it is such an important key!

OK锛孖 will add it.

@fifman

Finally I found the right solution! You won't know how hard I got here. It would really be nice to make it more clear in the doc how to set the mapleader simply because it is such an important key!

Hello, could you tell me how do you change your mapleader key finally ? I'm also interested on it, indeed default mapleader is "\", but for azerty keyboard, this is not a good mapleader key.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

onerciller picture onerciller  路  5Comments

eperfect picture eperfect  路  4Comments

linwaytin picture linwaytin  路  4Comments

teemola picture teemola  路  5Comments

zeroasterisk picture zeroasterisk  路  5Comments