I got autocmd BufWrite *.rb :RuboCop -a
in my ~/.vimrc
How to modify it to process *.jbuilder
files as well?
You can either add another file-glob, separated by ,
:
autocmd BufWrite *.rb,*.jbuilder :RuboCop -a
This is documented under :help autocmd-patterns
. Alternatively, of course, define a separate autocmd:
autocmd BufWrite *.rb :RuboCop -a
autocmd BufWrite *.jbuilder :RuboCop -a
If all these file globs already are detected to a single filetype inside Vim, you can also leverage that, and define a buffer-local trigger on that:
autocmd FileType ruby autocmd BufWrite <buffer> RuboCop -a
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With