tagbar
tagbar copied to clipboard
Tagbar doesn't find my preferred ctags version
( For anyone else experiencing this issue, the current solution is to set g:tagbar_ctags_bin
to your preferred ctags binary. Kudos to the developer for documenting this! )
I use tagbar at work, so I don't have direct control over which programs are installed outside my home folder. My PATH points to ~/my/exuberant/ctags
, but tagbar uses /usr/local/bin/ctags
anyways. This is a problem because that ctags isn't Exuberant ctags, which causes an error.
I think the default behavior should be to use the first ctags executable that appears in my path, because I've already told the system that's the ctags I want to use.
I experience this behavior on Ubuntu 14, but it doesn't seem like an os-specific issue.
I think you can set this in .vimrc to overcome this issue.
let g:tagbar_ctags_bin = '<your ctags exec >'
@brentshermana I'm a bit confused by this report because the plugin is looking through the $PATH
, it it calling VIM's executable()
function to check if various names are available, and that will use your system's path.
Perhaps what is happening is the list of names actually seems to check for exuberant-ctags variants in preference to universal-ctags (which is what we actually recommend!) and your "error" is not actually about it not being exuberant.
Oh I do see ... there is a preference towards a full path "/usr/local/bin/ctags" over "ctags" because that's what works for Homebrew & Macports installations so that we dodge the system's default "ctags" (which is BSD).
I'm not sure what to do about this actually, but until we rewrite not just to check for the first available executable but to check every executable until it finds one we like I think the answer is "keep setting the bin you want to use yourself".
Even though the answer to the original question is "specify it yourself", I'm keeping this bug report open as a reminder that this needs an overhaul:
-
We should be looking for possible Universal Ctags binaries in preference to Exuberant ones.
-
Don't just find the first executable and pass/fail based on whether we like that one. Keep checking available executables until we find one we like or run out of options.
👍 Thanks, that would be a major usability improvement