简体   繁体   中英

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?

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

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.

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.

您可以将键绑定到函数:TlistRefresh

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM