I'm just going by the help doc in github but it appears that 'NERDCreateDefaultMappings'
does exactly what you want for the first part, ie. toggle on/off all mappings (bindings)...
If set to 0, none of the default mappings will be created.
Then you can manually bind to your heart's content. The help for NERDCommenterMappings
has a bit of advice for that:
To change a mapping just map another key combo to the internal mapping. For example, to remap the |NERDCommenterComment| mapping to ",omg" you would put this line in your vimrc:
map ,omg <plug>NERDCommenterComment
Update: If you need more help let's look at how the default for NERDCommenterToggle
is constructed. It should be clear now that we don't override like a normal variable (:let x = y
) but rather we need to define a mapping. The relevant bits responsible for defining the default mapping...
call s:CreateMaps('nx', 'Toggle', 'Toggle', 'c<space>')
Signature of CreateMaps
:
function! s:CreateMaps(modes, target, desc, combo)
Actual map definition where modes
is split and iterated over such that mode
has each value, n
and x
, in turn...
execute mode . 'map <leader>' . a:combo . ' ' . plug
Where plug
is
let plug = '<plug>NERDCommenter' . a:target
So that translates to
nmap <leader>c<space> <plug>NERDCommenterToggle
xmap <leader>c<space> <plug>NERDCommenterToggle
So you want
nmap <C-/> <plug>NERDCommenterToggle
xmap <C-/> <plug>NERDCommenterToggle
You may not need the xmap
version.
(Don't forget you need to set NERDCreateDefaultMappings
to 0, too.)