simon
simon

Reputation: 943

ctags cannot open option file ".ctags"

ctags is not seeing my ~/.ctags file, so I've tried specifying it using the --options option but it always says it cannot find the file, no matter where I put it:

$ touch .ctags && ctags --options=.ctags
ctags: cannot open option file ".ctags" : No such file or directory

I'm using the latest homebrew version (5.8) and I've tried using HEAD as well.

Thanks!

Upvotes: 7

Views: 4027

Answers (3)

Taiwo Kolawole
Taiwo Kolawole

Reputation: 31

You have to specify the full path to the ctags options: /Users/your_username/.ctags instead of ~/.ctags

Upvotes: 1

JaredMcAteer
JaredMcAteer

Reputation: 22536

The fix for me was to change .ctags to .ctags.cnf. I have no explanation why this worked. But it seems that Exuberant Ctags requires an extension, I changed it to .ctags.bak it it works as well.

Upvotes: 7

pequatre
pequatre

Reputation: 1

This is slightly off-topic but I've had the same problem on Windows. I had a batch file called ctags.bat which contained the following line:

"C:\SOME_DIRECTORY\Vim Tools\ctags.exe" --options="%CD%\ctags.cnf"

This line was expanded into:

"C:\SOME_DIRECTORY\Vim Tools\ctags.exe" --options="MY_CURRENT_DIRECTORY\ctags.cnf"

Ctags was giving me the same error:

ctags.exe: cannot open option file "MY_CURRENT_DIRECTORY\ctags.cnf" : No such file or directory

Escaping the last \ made it work, i.e. I changed the line to:

"C:\SOME_DIRECTORY\Vim Tools\ctags.exe" --options="%CD%\\ctags.cnf"

Note the \\ before ctags.cnf

Regarding your problem on linux: try to add quotes around '.ctags':

ctags --options='./.ctags'

Upvotes: 0

Related Questions