Vim 和 GVim:leader 键不起作用 [英] Vim and GVim: leader key not working

查看:28
本文介绍了Vim 和 GVim:leader 键不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了一些插件,包括 NERDCommenter 和 NERDTree.不过,我无法让领导者钥匙为他们工作.这些是我输入 :map

I have some plugins installed, including NERDCommenter and NERDTree. I can't get the leader key to work right for them, though. These are the default configs when I type :map

v  \c<Space>     <Plug>NERDCommenterToggle
n  \c<Space>     <Plug>NERDCommenterToggle
v  \cc           <Plug>NERDCommenterComment
n  \cc           <Plug>NERDCommenterComment

\c 就像点击 c 一样.我已经尝试在我的主目录中的 .vimrc 中使用以下内容重新映射领导键:

\c<space> just works like hitting c<space>. I've tried remapping the leader key with the following in my .vimrc in my home directory:

let mapleader = ","

当我重新启动 vim 并输入 :map

This is reflected when I restart vim and type :map

v  ,c<Space>     <Plug>NERDCommenterToggle
n  ,c<Space>     <Plug>NERDCommenterToggle
v  ,cc           <Plug>NERDCommenterComment
n  ,cc           <Plug>NERDCommenterComment

但是,,c 的行为就像我点击了 c.这是怎么回事,我该如何解决?

But still, ,c<space> just behaves like I'm hitting c<space>. What's going on and how do I fix this?

编辑:在 VIM 中也用相同的行为对此进行了测试.

Edit: tested this in VIM as well with the same behavior.

推荐答案

映射看起来很有趣,我期待

The mappings seem funny, I'd expect

v  <Leader>c<Space>     <Plug>NERDCommenterToggle
n  <Leader>c<Space>     <Plug>NERDCommenterToggle
v  <Leader>cc           <Plug>NERDCommenterComment
n  <Leader>cc           <Plug>NERDCommenterComment

让他们工作.我怀疑您在插件加载后设置了mapleader

for them to work. I suspect you are setting the mapleader after the plugins get loaded

这篇关于Vim 和 GVim:leader 键不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆