Ruby-like syntax in VIM for Thor

How to configure vim to use the same syntax highlighting for Thor , how is it done for ruby? When I edit a * .thor file, I can use :set syntax=rubyone that works, but is not permanent. Is there a way to do something in my .vimrc file to conditionally set the syntax in ruby ​​if it is * .thor? Maybe create a torus syntax file and inherit from ruby?

+5
source share
2 answers
au BufRead,BufNewFile *.thor set filetype=ruby

I think this should be enough ... maybe this if you want to configure it later:

au BufRead,BufNewFile *.thor set filetype=thor
au! Syntax thor source $HOME/.vim/syntax/thor.vim

and copy the ruby ​​.vim syntax highlight file to $HOME/.vim/syntax/thor.vim

+11
autocmd BufNewFile,BufRead *.thor set syntax=ruby

.

+4

All Articles