1
0
Fork 0
mirror of synced 2024-11-25 10:15:35 -05:00
ultimate-vim/sources_non_forked/vim-ruby/ftdetect/ruby.vim

43 lines
1,013 B
VimL
Raw Normal View History

" Officially distributed filetypes
" Support functions {{{
function! s:setf(filetype) abort
if &filetype !~# '\<'.a:filetype.'\>'
let &filetype = a:filetype
endif
endfunction
func! s:StarSetf(ft)
if expand("<amatch>") !~ g:ft_ignore_pat
exe 'setf ' . a:ft
endif
endfunc
" }}}
" HTML with Ruby - eRuby
au BufNewFile,BufRead *.erb,*.rhtml call s:setf('eruby')
" Interactive Ruby shell
au BufNewFile,BufRead .irbrc,irbrc call s:setf('ruby')
" Ruby
au BufNewFile,BufRead *.rb,*.rbw,*.gemspec call s:setf('ruby')
" Rackup
au BufNewFile,BufRead *.ru call s:setf('ruby')
" Bundler
au BufNewFile,BufRead Gemfile call s:setf('ruby')
" Ruby on Rails
au BufNewFile,BufRead *.builder,*.rxml,*.rjs,*.ruby call s:setf('ruby')
" Rakefile
au BufNewFile,BufRead [rR]akefile,*.rake call s:setf('ruby')
au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby')
" Rantfile
au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby')
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: