如何在vimrc中基于plugin命令加载vim命令

时间:2012-02-22 11:41:45

标签: vim vim-plugin

我尝试使用Nerd Commenter插件制作vim命令。基本上在一些帮助here之后,它看起来像:

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

当我使用:so .vimrc时它起作用,但是当我重新启动vim时它只执行 5 g g v 1 2 g g 没有 c < / KBD> 空间。我想是因为 c space 部分来自插件,但我想知道是否有办法解决这个问题。有人可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

也许你在.vimrc中设置“mapleader”之前定义了命令?

来自: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.
相关问题