I use vim with various plugins for editing ruby code. I have proper syntax highlighting set up but I was wondering if anyone knew of a way to get ruby syntax checking, similar to what you might see in an IDE such as visual studio, radrails, etc?
Something that would simply turn stuff red or break highlighting when I'm missing an 'end' or have an improperly constructed line of code would be sweet.
I googled and came across this plugin, http://github.com/scrooloose/syntastic/tree/master but I was wondering if anyone had any better suggestions.
You can syntax check the current buffer in ruby without downloading any plugins. The command is:
:w !ruby -c
awesome_person is right, ":w !ruby -c"
will do. To make it more convenient, add this line in your ~/.vimrc:
autocmd FileType ruby map <F9> :w<CR>:!ruby -c %<CR>
Then the syntax gets checked on pressing F9 key.
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