如何调试未加载的 Vim 插件?
我正在尝试使用 Vim snipMate 插件,并且已按照其指示安装了它,但是当我按 Tab 键时没有任何反应。
- 我该如何调试这个? Vim 尝试加载内容时是否会生成日志文件?
- 我怎样才能看到哪些插件正确加载?
我尝试过 :sni
来查看是否安装了名为 snipsomething 的东西,但没有完成任何操作。
在安装教程中,它没有提到向我的 vimrc
添加任何内容,但我猜它会自动找到 /plugin/
目录?
我在 Windows 和 Unix 上运行,并且我有相同的配置文件,也有同样的问题。
其他插件如 NerdTree 加载正常。
更新:在另一个问题之后,我尝试了 :inoremap
和 :snoremap
以及
条目提到 TriggerSnippet()
是有的:
例如,
s <Tab> * <Esc>i <Right><C-R>=TriggerSnippet()<CR>
- 这是否意味着它已启用?
I'm trying to use the Vim snipMate plugin, and I've installed it as it directs, but when I press tab nothing happens.
- How can I debug this? Are there log files Vim makes when it tries to load stuff?
- How can I see what plugins its loaded correctly?
I've tried :sni<tab>
to see if there's anything called snipsomething installed but nothing completes.
In the installation tutorial it doesn't mention adding anything into my vimrc
but I guess it finds the /plugin/
dir automatically?
I'm running on Windows and Unix and I have the same profile with the same problem.
Other plugins like NerdTree are loading OK.
Update: Following another question, I've tried :inoremap
and :snoremap
and the <Tab>
entry mentioning TriggerSnippet()
is there:
e.g.
s <Tab> * <Esc>i <Right><C-R>=TriggerSnippet()<CR>
- Does this mean it's enabled?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
会告诉您绑定到
的内容:scriptnames 会告诉您加载了哪些脚本。
will tell you what is bound to
<tab>
:scriptnames
will tell you what scripts were loaded.您可以在插件代码中插入
echo“Loaded so far”
等内容 - 如果执行echo
,文本将显示在底行。通过 printf 进行调试:) 粗鲁,但简单且有效。另外:
plugin
会自动加载。plugins
不是。You can insert
echo "Loaded so far"
and the like inside the plugin code - the text will be displayed in the bottom line if theecho
is executed. Debugging by printf :) Crude, but simple and works.Also:
plugin
is loaded automagically.plugins
is not.看起来我在
C:\Program Files\Vim\vimfiles\
目录中有一些狡猾的东西,它取代了我的用户首选项。我刚刚删除了该目录,它现在可以工作了。It looks like I had something dodgy in
C:\Program Files\Vim\vimfiles\
directory which was superceding my user preferences. I just blew away that directory and it works now.