Search code examples
vimconfigurationmappingkeyboard-shortcutscustomization

Can I use SPACE as mapleader in VIM?


From http://items.sjbach.com/319/configuring-vim-right (2009 archive from original) I got that you were supposed to be able to use Space as the mapleader in vim. I've tried but it does not seem to work. Is there anyone who made it work?

Tried:

let mapleader = <space>

Solution

  • Try the following instead:

    let mapleader=" "
    

    And remember to write the following line before that, to make sure spacebar doesn't have any mapping beforehand:

    nnoremap <SPACE> <Nop>