我安装了一些插件,包括NERDCommenter和NERDTree。不过,我不能让leader密钥为他们工作。这些是我输入:map
时的默认配置
v \c<Space> <Plug>NERDCommenterToggle
n \c<Space> <Plug>NERDCommenterToggle
v \cc <Plug>NERDCommenterComment
n \cc <Plug>NERDCommenterComment
\c<space>
就像敲击c<space>
一样工作。我已经尝试使用主目录中.vimrc
中的以下内容重新映射leader密钥:
let mapleader = ","
这在我重新启动vim并输入:map
时就会反映出来
v ,c<Space> <Plug>NERDCommenterToggle
n ,c<Space> <Plug>NERDCommenterToggle
v ,cc <Plug>NERDCommenterComment
n ,cc <Plug>NERDCommenterComment
但是,,c<space>
的表现就像我在打c<space>
一样。这是怎么回事,我该怎么解决这个问题?
编辑:使用相同的行为在VIM中测试了这一点。
发布于 2011-11-22 04:34:13
映射看起来很有趣,我想是的
v <Leader>c<Space> <Plug>NERDCommenterToggle
n <Leader>c<Space> <Plug>NERDCommenterToggle
v <Leader>cc <Plug>NERDCommenterComment
n <Leader>cc <Plug>NERDCommenterComment
才能让它们工作。我怀疑你在插件加载后设置了mapleader
发布于 2012-08-12 05:23:26
在加载任何插件之前定义mapleader
和maplocalleader
键。
就在你的.vimrc上!
发布于 2013-03-12 19:48:05
您可能已将超时设置为零。在这种情况下,vim不会在mapleader之后等待密钥。
:set timeout timeoutlen=0 ttimeoutlen=0
https://stackoverflow.com/questions/8189055
复制相似问题