Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tagbar doesn't find my preferred ctags version #519

Open
brentshermana opened this issue Jan 4, 2019 · 5 comments
Open

Tagbar doesn't find my preferred ctags version #519

brentshermana opened this issue Jan 4, 2019 · 5 comments

Comments

@brentshermana
Copy link

( 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.

@hungkero
Copy link

hungkero commented Jul 5, 2019

I think you can set this in .vimrc to overcome this issue.
let g:tagbar_ctags_bin = '<your ctags exec >'

@alerque
Copy link
Member

alerque commented Dec 3, 2019

@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.

@alerque
Copy link
Member

alerque commented Dec 3, 2019

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".

@alerque
Copy link
Member

alerque commented Dec 3, 2019

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:

  1. We should be looking for possible Universal Ctags binaries in preference to Exuberant ones.

  2. 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.

@brentshermana
Copy link
Author

👍 Thanks, that would be a major usability improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants