Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim-chef detection gets overruled by vim-ruby #2

Open
janbeerden opened this issue Mar 3, 2014 · 6 comments
Open

vim-chef detection gets overruled by vim-ruby #2

janbeerden opened this issue Mar 3, 2014 · 6 comments

Comments

@janbeerden
Copy link

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

@dougireton
Copy link
Owner

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

@janbeerden
Copy link
Author

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.

@prometheanfire
Copy link

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

@dougireton
Copy link
Owner

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
#2 (comment).

@janbeerden
Copy link
Author

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.

@mattsmitton
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants