When ctags is used on Mac, the following error occurs:
Ctags: Illegal option -- r
The problem is that the pre-installed ctags are Mac versions, and the ctags we usually call exuberant ctags. The above-R command can be used only by the latter.
The solution is to reinstallExuberant version of ctags:
Http://gmarik.info/blog/2010/10/08/ctags-on-OSX
Run in Shell
Ctags-R
The new version of ctags is installed successfully.
Run in VIM:
:! Ctags-R
The above error message still appears. Because Vim calls :! Ctags indicates to use the shell tool ctags in the shell. The borrowed shell does not know where the newly installed exuberent ctags are, it can only continue to call the ctags pre-installed on Mac. Therefore, the error persists.
The solution is to make every shell (no matter where it is opened or borrowed) have to recognize the new ctags.
Open ~ /. Bashrc: export the bin path of the ctags you just installed to $ path.
For example:
Export Path = "/usr/local/bin: $ path"