vim-chef icon indicating copy to clipboard operation
vim-chef copied to clipboard

vim-chef detection gets overruled by vim-ruby

Open janbeerden opened this issue 10 years ago • 6 comments

When I open a .rb file it is always detected by vim-ruby as ruby. Both are loaded using pathogen.

janbeerden avatar Mar 03 '14 15:03 janbeerden

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

dougireton avatar Mar 11 '14 04:03 dougireton

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.

janbeerden avatar Mar 16 '14 10:03 janbeerden

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 :|

prometheanfire avatar Jul 08 '14 21:07 prometheanfire

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.

dougireton avatar Jul 09 '14 15:07 dougireton

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.

janbeerden avatar Jul 10 '14 22:07 janbeerden

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

mattsmitton avatar Mar 19 '15 08:03 mattsmitton