Vim: Slow TagList Plugin Update

I am using Vim with TagList in development. TagList seems very nice, but one problem is that it takes a long time to update, so if, for example, I mean function A for function B in the same file, it takes about 5 seconds to get TagList updated. Is there a way to make this interval shorter, for example, half a second?

+8
vim taglist
source share
4 answers

I have the same problem as you and is inspired by ThePosey's answer.

You can find the autocmd command on line 1678 in taglist.vim, which looks like

autocmd BufEnter * call s:Tlist_Refresh() 

which expects the BufEnter event to refresh the tag window.

I just changed it to

 autocmd BufEnter,CursorMovedI * call s:Tlist_Refresh() 

and it will switch Tlist_Refresh while your cursor moves in insert mode. I removed the CursorMoved event for it, making too many other commands difficult.

I think this should meet the requirements for most cases. A side effect is some commands that require moving the cursor.

Edit:

An easier way to put this line in a .vimrc file is:

 autocmd CursorMovedI * silent! TlistHighlightTag 

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

+3
source share

You can try setting the update time to 1000 ms. I did this with a large file, and everything works very well, updating happens every second;

 set ut=1000 

see if it helps

+3
source share

You can bind a key to a function: TlistRefresh

 map <silent> <F1> :TlistRefresh<CR> 
+1
source share

Kind of an old question, but for taglist 4.6 (at least) the update period is controlled by updated time (autocmd CursorHold .. line 1735)

For interactivity, Tom Yu's answer is probably the best solution.

+1
source share

Source: https://habr.com/ru/post/650575/


All Articles