tagbar
tagbar copied to clipboard
Avoid tagbar runs all the time in new opened buffer but on demand
Hi,
From usage section in help, tagbar is running all the time and each time I open a file in buffer. It pass by vimrun out of job_start( to run ctag executable and update tags I imagine.
How ca I set option in order to disable this 'all the time' mode and switch to 'on demand' mode ?
Thank you
Nota : just opening $MYVIMRC in gvim, tagbar take a lot of time.
FUNCTIONS SORTED ON TOTAL TIME count total (s) self (s) function 5 5.195276 0.038170 <SNR>109_ExecuteCtags() 19 3.518753 0.019814 <SNR>109_AutoUpdate() 3 3.486098 0.099733 <SNR>109_ProcessFile() 3 3.359691 0.001272 <SNR>109_ExecuteCtagsOnFile() 16 3.150940 0.002827 <SNR>178_delete()
background ctags calling takes 5-6 seconds each time on windows.
see my issue: https://github.com/majutsushi/tagbar/issues/475
Hum OK i understand but is there an option to disable 'always' ctags launch on each opened buffer and launch it on demand.
Le 4 févr. 2018 17:59, "Linwei" [email protected] a écrit :
background ctags calling costs me 5-6s each time on windows.
#475 https://github.com/majutsushi/tagbar/issues/475
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/majutsushi/tagbar/issues/477#issuecomment-362921847, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtp3luwhySb-Z-HslHPmy3F2vL7uOeWks5tReHzgaJpZM4R4Xx1 .
There is an alternative for tagbar, currently I have switch to LeaderF/CtrlP from tagbar. LeaderF/CtrlP can display function list of the current buffer and apply fuzzy match on the function list:
In LeaderF you can use command :LeaderfFunction (bound to my F9) to display a function list like tagbar:

ctags are invoked on demand and executed in the background, and Vim will never get stuck. You can use arrow keys up/down (or c-j/c-k) to navigate between function names or use leaderf's fuzzy matcher to find one.
The only disadvantage of leaderf is python requirement. If you don't get the python support in your vim, you can also use CtrlP which is definitely 100% vimscript.
CtrlP has a plugin ctrlp-funky which provide a :CtrlPFunky command for you to display the function list like LeaderF and enable you using arrow keys or fuzzy match to navigate function names:

If you don't need them right now, they will never show them up or invoke ctags executable. But if you do, just press F9 to popup the function list and ESC to close it.
Very handy.
Hi and thank you a lot for this alternative.
CtrpFunky seems fast. But It does not display class with public/private methods like tagbar isn't it ?
Best, Nicholas
2018-02-07 19:49 GMT+01:00 Linwei [email protected]:
There is an alternative for tagbar, currently I have switch to LeaderF/CtrlP from tagbar. LeaderF/CtrlP can display function list of the current buffer and apply fuzzy match on the function list:
In LeaderF you can use command :LeaderfFunction (bound to my F9) to display a function list like tagbar:
[image: leaderf2] https://user-images.githubusercontent.com/3035071/35934809-86eb76c0-0c79-11e8-896b-8e519af092da.png
ctags are invoked on demand and executed in the background. You can use c-j, c-k to navigate between function names or use leaderf's fuzzy matcher to find one.
The only disadvantage of leaderf is python requirement. If you don't get the python support in your vim, you can also use CtrlP https://github.com/ctrlpvim/ctrlp.vim which is definitely 100% vimscript.
CtrlP has a plugin ctrlp-funky https://github.com/tacahiroy/ctrlp-funky which provide a :CtrlPFunky command for you to display the function list like LeaderF and enable you using arrow keys or fuzzy match to navigate function names.
Now I am very happy with them.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/majutsushi/tagbar/issues/477#issuecomment-363870570, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtp3gQarJezUNkVWUOAcmhH39-AyDqYks5tSfBQgaJpZM4R4Xx1 .
Another promising competitor you may have a look: vista
keywords: universal-ctags, lsp, background task, popup-window
I think fixing this is urgent. Most of the time it doesn't bother me, but opening a big file somewhere and not saving it shouldn't result in a couple seconds of hand and a tags file I never used!
All the talk of alternatives has it's place —I myself use a different plugin for seeking to tags— but lets keep this issue about fixing the originally reported issue in this plugin. Thanks.
In most cases we do need to run when a buffer is opened because even if the sidebar isn't used, the airline might show tags or other jump commands may be invoked.
However we need to make sure the tags parsing doesn't block the UI. This probably means using job control to background the operation, although an interesting side note is that Python runs in a separate process too.
Can this issue be addressed by #656 to avoid running tags on a file greater than a certain size? Or is there something more needed for this issue?