Ctags cannot open option file .ctags

ctags does not see my ~/.ctags , so I tried to specify it with the --options , but it always says that 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 am using the latest version of homebrew (5.8), and I also tried using HEAD.

Thanks!

+6
source share
3 answers

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

+5
source

This is a little off topic, but I have the same problem on Windows. I had a batch file named ctags.bat that contained the following line:

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

This line has been expanded to:

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

Ctags gave me the same error:

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

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

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

Pay attention to \\ before ctags.cnf

Regarding your linux problem: try adding quotes around ".ctags":

 ctags --options='./.ctags' 
0
source

You must specify the full path to the ctags parameters: /Users/your_username/.ctags instead of ~/.ctags

0
source

All Articles