Soon after starting a new project I realized, that I'm not getting the correct syntax highlighting for my RSpec files.
At first I thought this is just because of my project specific .vimrc
, which are loaded via set exrc
. But even after I deleted it, it didn't help.
I also thought that the problem is in the spec file itself, that it doesn't get recognized as RSpec, so I took a file from another project, copied it over, and it still isn't getting properly highlighted.
This is the same file opened in two different places. The one on the left is in the original project, where it does get highlighting, and the one on the right is the copied version.
The same thing happens for all the RSpec files in that one project, but it seems to work everywhere else.
Here is my ~/.vimrc, but I don't think that's of any relevance, because I never had this issue before, only in this specific project.
You're using janus so you have rails.vim installed. As you can see here, that plugin defines the syntax methods for you and that's the reason why you have the RSpec syntax enabled only in rails projects.
If you want to enable that syntaxt in each spec file you can add the following to your vimrc:
autocmd BufRead *_spec.rb syn keyword rubyRspec describe context it specify it_should_behave_like before after setup subject its shared_examples_for shared_context let
highlight def link rubyRspec Function
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