Question

I tried to make vim command using Nerd Commenter plugin. Basically after some help here, it looks like:

command! -nargs=? -range=% Ct :normal <line1>ggv<line2>gg<Leader>c<space>

It works when I use :so .vimrc, but when I restart vim it only performs 5ggv12gg without ,cspace. I guess it is because the ,cspace part is from plugin, but I wonder if there is some way to fix this. Anyone could help?

Was it helpful?

Solution

Perhaps you are defining the command before setting "mapleader" in your .vimrc?

From :help mapleader:

Note that the value of "mapleader" is used at the moment the mapping is
defined.  Changing "mapleader" after that has no effect for already defined
mappings.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top