vim-chef
vim-chef copied to clipboard
vim-chef detection gets overruled by vim-ruby
When I open a .rb file it is always detected by vim-ruby as ruby. Both are loaded using pathogen.
When you run :scriptnames
in Vim, does vim-chef get loaded after vim-ruby? Like this:
6: ~/.vim/bundle/vim-ruby/ftdetect/ruby.vim
7: ~/.vim/bundle/vim-chef/ftdetect/chef.vim
Also, the vim-chef ftdetect assumes the following directory structure:
cookbooks/<your_cookbook>/...
or
chef-repo/environments/*.rb
or
chef-repo/environments/*.rb
10: ~/.vim/bundle/vim-chef/ftdetect/chef.vim
11: ~/.vim/bundle/vim-jquery/ftdetect/jquery.vim
12: ~/.vim/bundle/vim-ruby/ftdetect/ruby.vim
None of the directory structures seem to work.
I am getting the same issue, here's the output of scriptnames (shortened)
12: ~/.vim/bundle/vim-chef/ftdetect/chef.vim
59: /usr/share/vim/vim74/ftplugin/ruby.vim
60: /usr/share/vim/vim74/syntax/ruby.vim
61: /usr/share/vim/vim74/indent/ruby.vim
62: ~/.vim/bundle/vim-chef/ftplugin/chef.vim
so it does look like it's loaded before and after :|
I will try to look at this this week. Sorry it's not working for you.
Doug
Thanks,
Doug Ireton
On Tue, Jul 8, 2014 at 2:20 PM, Matthew Thode [email protected] wrote:
I am getting the same issue, here's the output of scriptnames (shortened)
12: ~/.vim/bundle/vim-chef/ftdetect/chef.vim 59: /usr/share/vim/vim74/ftplugin/ruby.vim 60: /usr/share/vim/vim74/syntax/ruby.vim 61: /usr/share/vim/vim74/indent/ruby.vim
— Reply to this email directly or view it on GitHub https://github.com/dougireton/vim-chef/issues/2#issuecomment-48400971.
Hi Doug
I've managed to find a workaround by modifying the vim-ruby bundle.
More specific vim-ruby/ftdetect/ruby.vim line 2. From: au BufNewFile,BufRead .rb,.rbw,.gemspec set filetype=ruby To: au BufNewFile,BufRead *.rb,.rbw,*.gemspec setfiletype=ruby
With this modification the vim-ruby bundle does not override the ruby.chef filetype.
I was able to work around this by adding this to my .vimrc file:
autocmd BufRead,BufNewFile /my/path/to/cookbooks/* set syntax=ruby.chef