mirror of
https://github.com/amix/vimrc
synced 2025-06-23 15:04:59 +08:00
Added and updated some plugins
Added: vim-ruby, typescript-vim, vim-javascript Updated: rust-vim
This commit is contained in:
42
sources_non_forked/vim-ruby/ftdetect/ruby.vim
Normal file
42
sources_non_forked/vim-ruby/ftdetect/ruby.vim
Normal file
@ -0,0 +1,42 @@
|
||||
" 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:
|
Reference in New Issue
Block a user