Vim:TagList 插件更新缓慢
我在开发中使用 Vim 和 TagList 。 TagList看起来很不错,但是有一个问题是刷新需要很长时间,所以如果我的意思是从同一个文件中的函数A到函数B,TagList需要大约5秒的时间才能获得已更新。有没有办法缩短这个间隔,例如半秒?
I am using Vim with TagList in development. TagList seems to be very nice, but one problem with that is that it takes a long time to refreshe, so if for example I mean from the function A to the function B in the same file, it takes around 5 seconds for TagList to get updated. Is there anyway to make this interval shorter, like half a second for example?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以尝试将更新时间设置为 1000 毫秒。我用一个大文件执行此操作,一切都运行良好,每秒都会刷新;
看看是否有帮助
You can try setting the updatetime to 1000ms. I did this with a big file and everything is working very well, the refresh occurs every second;
see if it helps
我和你有同样的问题,并受到 ThePosey 答案的启发。
您可以在 taglist.vim 的第 1678 行找到“autocmd”命令,它看起来
等待 BufEnter 事件来刷新标签窗口。
我刚刚将其修改为
,当光标在插入模式下移动时,它将切换 Tlist_Refresh。
我删除了 CursorMoved 事件,因为它妨碍了太多其他命令。
我认为这应该可以满足大多数情况的要求。副作用是一些需要移动光标的命令变得无效。
编辑:
更简单的方法是将这一行放在 .vimrc 文件中:
顺便说一句,没有命令 TlistRefresh,请改用 TlistHighlightTag。
I have the same problem as yours and inspired by ThePosey's answer.
You can find the "autocmd" command on line 1678 in the taglist.vim which looks
that waits for a BufEnter event to refresh the tag window.
I just modified it to
and it will toggle Tlist_Refresh while your cursor is moving in insert mode.
I deleted CursorMoved event for it hinders too many other commands.
I think this should meet the requirement for most cases. The side effect is some commands that requires moving cursor becomes invalid.
Edit:
An easier way would be put this line in the .vimrc file:
And BTW, there is no command TlistRefresh, use TlistHighlightTag instead.
您可以将一个键绑定到函数:TlistRefresh
You can bind a key to the function :TlistRefresh
这是一个老问题,但对于taglist 4.6(至少)来说,更新周期由更新时间控制(autocmd CursorHold ..第1735行)
对于交互性,Tom Yu的答案可能是最好的解决方案。
Kind of an old question, but for taglist 4.6 (at least) the update period is controlled by the updatetime (autocmd CursorHold .. line 1735)
For interactivity, Tom Yu's answer is probably the best solution.