Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use SPACE as mapleader in VIM?

From http://items.sjbach.com/319/configuring-vim-right 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. Anyone who have made it work?

Tried:

let mapleader = <space> 
like image 235
Marlun Avatar asked Jan 15 '09 10:01

Marlun


People also ask

What is Mapleader in Vim?

leader in vimrc file: explanation Vim's <leader> key is a way of creating a namespace for commands you want to define. Vim already maps most keys and combinations of Ctrl + (some key), so <leader>(some key) is where you (or plugins) can add custom behavior.

How do I map the leader key in Vim?

Use the mapleader variable in your . Now use the following to set the leader key. In the above example, I mapped the leader to , . This is much easier to access than \ , but you can map the leader to whatever key you'd like! For this change to take effect, you'll have to re-launch Vim.


1 Answers

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> 
like image 139
Zsolt Botykai Avatar answered Sep 23 '22 23:09

Zsolt Botykai