2

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?

Community
  • 1
  • 1
Lucas
  • 2,587
  • 1
  • 18
  • 17

1 Answers1

1

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.
kyoto
  • 125
  • 1
  • 1
  • 7