How do I get ripper-tags to automatically generate a tags
file for my ruby buffers upon save?
1 Answer
Disclaimer: I don't have ripper-tags installed, this is my best guess on browsing the documentation.
In the documentation it says that the typical usage is:
ripper-tags -R --exclude=vendor
This parses all
*.rb
files in the current project, excluding ones invendor/
directory, and saves tags in Vim format to a file named./tags
.
Using this with an autocmd on save I would get something like the following:
autocmd BufWritePost *.rb !ripper-tags -R --exclude=vendor
autocmd BufWritePost
Sets up an auto command to do something everytime we write to a file*.rb
Only execute on ruby files (.rb extension)!...
Executes following command in a shell
Put this line in your vimrc
file to enable the auto command.
See :h BufWritePost
and :h !
for more info.
vim
.