Rafid
Rafid

Reputation: 20189

Vim: TagList Plugin Slow Update

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?

Upvotes: 8

Views: 1660

Answers (4)

MaikoID
MaikoID

Reputation: 4997

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;

set ut=1000

see if it helps

Upvotes: 4

ttyridal
ttyridal

Reputation: 468

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.

Upvotes: 1

Tom Yu
Tom Yu

Reputation: 131

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.

Upvotes: 3

ThePosey
ThePosey

Reputation: 2734

You can bind a key to the function :TlistRefresh

map <silent> <F1> :TlistRefresh<CR>

Upvotes: 1

Related Questions