diff --git a/autoload/SpaceVim/mapping/guide.vim b/autoload/SpaceVim/mapping/guide.vim index 294a32df7..d19dd17d9 100644 --- a/autoload/SpaceVim/mapping/guide.vim +++ b/autoload/SpaceVim/mapping/guide.vim @@ -112,7 +112,7 @@ function! s:start_parser(key, dict) abort " {{{ if a:key ==# '[KEYs]' return endif - let key = a:key ==? g:spacevim_default_custom_leader ? ' ' : a:key + let key = a:key ==? ' ' ? '' : a:key 0verbose let readmap = s:CMP.execute('map ' . key, 'silent') diff --git a/autoload/SpaceVim/mapping/space.vim b/autoload/SpaceVim/mapping/space.vim index 52053847e..955c6bcc5 100644 --- a/autoload/SpaceVim/mapping/space.vim +++ b/autoload/SpaceVim/mapping/space.vim @@ -34,8 +34,10 @@ function! SpaceVim#mapping#space#init() abort if s:has_map_to_spc() return endif - nnoremap [SPC] :LeaderGuide g:spacevim_default_custom_leader - vnoremap [SPC] :LeaderGuideVisual g:spacevim_default_custom_leader + if g:spacevim_default_custom_leader ==# '' + nnoremap [SPC] :LeaderGuide ' ' + vnoremap [SPC] :LeaderGuideVisual ' ' + endif exe printf('nmap %s [SPC]', g:spacevim_default_custom_leader) exe printf('vmap %s [SPC]', g:spacevim_default_custom_leader) if !g:spacevim_vimcompatible && g:spacevim_enable_language_specific_leader