Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: TagList Plugin Slow Update

Tags:

vim

taglist

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?

like image 284
Rafid Avatar asked Dec 31 '10 07:12

Rafid


1 Answers

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

autocmd BufEnter * call s:Tlist_Refresh()

that waits for a BufEnter event to refresh the tag window.

I just modified it to

autocmd BufEnter,CursorMovedI * call s:Tlist_Refresh()

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:

autocmd CursorMovedI * silent! TlistHighlightTag

And BTW, there is no command TlistRefresh, use TlistHighlightTag instead.

like image 145
Tom Yu Avatar answered Oct 19 '22 00:10

Tom Yu