为什么 vim 显示“未连接”当我使用重新映射的键访问插件命令时
我正在尝试使用 F9 来允许 NERDTree 进行切换。所以我做了如下:
nnoremap <silent> <F9> :NERDTreeToggle<CR>
当我点击 F9 时,我从 vim 收到以下消息
Not Connected
Not Connected
Press ENTER or type a command to continue
如果我执行 :source ~/.vimrc
,我对 F9 的重新映射将按预期工作,然后切换 NerdTree正如预期的那样。
另外,如果我在命令模式下的任何时候使用命令 :NERDTreeToggle
,它也可以工作。
有什么想法吗?
I'm trying to use F9 to allow NERDTree to toggle. So what I did was the following:
nnoremap <silent> <F9> :NERDTreeToggle<CR>
When I hit F9, I get the following message back from vim
Not Connected
Not Connected
Press ENTER or type a command to continue
If I do :source ~/.vimrc
, my remap for F9 works as expected and NerdTree is then toggled as expected.
Also if I use the command :NERDTreeToggle
at any point from command mode, it works as well.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用@michaelmichael 和@romainl 的建议,我能够确定我有一个插件覆盖了 key 。
答案是...使用 :verbose map 对其进行调试,然后查看是否需要禁用它。
Using @michaelmichael's and @romainl's suggestion, I was able to determine that I had a pluging overwriting the key .
Answer is... Debug it using :verbose map and then see if you need to disable it.
我遇到了同样的问题 -
~./vim/plugin
目录中有debugger.py
和debugger.vim
。我删除了这些未使用的插件,我的映射恢复正常。在将 OS X 升级到 Mavericks 后才曝光。
I had the same issue - had
debugger.py
anddebugger.vim
in the~./vim/plugin
directory. I removed these unused plugins and my mappings returned to normal.Came to light after upgrading OS X to Mavericks.