i want to set the tags variable to the set of all gotags
files i generated in specific folder(s) using exuberant Ctags
. (gotags
is nothing but the tags
file renamed).
i put following lines in my .vimrc
file.
set tags+=/usr/local/go/src/gotags
set tags+=`find /home/vimal/gowork/src -name gotags`
but it doesnt work and i get the following error
$ vi ~/.vimrc
Error detected while processing /home/vimal/.vimrc:
line 157:
E518: Unknown option: /home/vimal/gowork/src
Press ENTER or type command to continue
how can i fix the error and set the tags
variable with the value: list of all the gotags
files under one directory tree.
Inventing new syntax tends not to work that well in practice. Use system()
to run external commands from Vim, not backticks. Also set
in Vim is weird, it doesn't evaluate RHS the way you expect. Most of the time it's a lot simpler to use let &option = ...
instead of set option=...
.
Anyway, to answer your question, you don't need to run find(1)
for that, plain Vim functions are enough for what you want:
let &tags = join(extend([&tags, '/usr/local/go/src/gotags'],
\ findfile('gotags', '/home/vimal/gowork/src', -1)), ',')