I have some plugins installed, including NERDCommenter and NERDTree. I can’t get the leader key to work right for them, though. These are the default configs when I type :map
v \c<Space> <Plug>NERDCommenterToggle
n \c<Space> <Plug>NERDCommenterToggle
v \cc <Plug>NERDCommenterComment
n \cc <Plug>NERDCommenterComment
\c<space> just works like hitting c<space>. I’ve tried remapping the leader key with the following in my .vimrc in my home directory:
let mapleader = ","
This is reflected when I restart vim and type :map
v ,c<Space> <Plug>NERDCommenterToggle
n ,c<Space> <Plug>NERDCommenterToggle
v ,cc <Plug>NERDCommenterComment
n ,cc <Plug>NERDCommenterComment
But still, ,c<space> just behaves like I’m hitting c<space>. What’s going on and how do I fix this?
Edit: tested this in VIM as well with the same behavior.
The mappings seem funny, I’d expect
for them to work. I suspect you are setting the mapleader after the plugins get loaded