2019-06-08 07:14:56 -04:00
|
|
|
function! s:setf(filetype) abort
|
|
|
|
if &filetype !=# a:filetype
|
|
|
|
let &filetype = a:filetype
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
2016-07-26 07:47:20 -04:00
|
|
|
" Enable jsx syntax by default
|
|
|
|
if !exists('g:jsx_ext_required')
|
|
|
|
let g:jsx_ext_required = 0
|
|
|
|
endif
|
2016-07-26 07:50:28 -04:00
|
|
|
|
2019-03-10 16:16:44 -04:00
|
|
|
" Make csv loading faster
|
|
|
|
if !exists('g:csv_start')
|
|
|
|
let g:csv_start = 1
|
|
|
|
endif
|
|
|
|
if !exists('g:csv_end')
|
|
|
|
let g:csv_end = 2
|
|
|
|
endif
|
|
|
|
|
2016-07-26 07:50:28 -04:00
|
|
|
" Disable json concealing by default
|
|
|
|
if !exists('g:vim_json_syntax_conceal')
|
|
|
|
let g:vim_json_syntax_conceal = 0
|
|
|
|
endif
|
2017-02-02 16:11:43 -05:00
|
|
|
|
|
|
|
let g:filetype_euphoria = 'elixir'
|
2017-11-19 15:51:33 -05:00
|
|
|
|
|
|
|
augroup filetypedetect
|
|
|
|
autocmd BufNewFile,BufReadPost *.vb setlocal filetype=vbnet
|
|
|
|
augroup END
|
2017-12-30 05:55:40 -05:00
|
|
|
|
|
|
|
let g:python_highlight_all = 1
|
2017-12-30 09:53:17 -05:00
|
|
|
|
|
|
|
augroup filetypedetect
|
|
|
|
if v:version < 704
|
|
|
|
" NOTE: this line fixes an issue with the default system-wide lisp ftplugin
|
|
|
|
" which didn't define b:undo_ftplugin on older Vim versions
|
|
|
|
" (*.jl files are recognized as lisp)
|
|
|
|
autocmd BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<"
|
|
|
|
endif
|
|
|
|
|
|
|
|
autocmd BufRead,BufNewFile *.jl set filetype=julia
|
2018-01-10 17:54:03 -05:00
|
|
|
|
|
|
|
" coffeescript
|
|
|
|
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
|
|
|
|
autocmd BufNewFile,BufRead *Cakefile set filetype=coffee
|
|
|
|
autocmd BufNewFile,BufRead *.coffeekup,*.ck set filetype=coffee
|
|
|
|
autocmd BufNewFile,BufRead *._coffee set filetype=coffee
|
|
|
|
autocmd BufNewFile,BufRead *.litcoffee set filetype=litcoffee
|
|
|
|
autocmd BufNewFile,BufRead *.coffee.md set filetype=litcoffee
|
|
|
|
|
|
|
|
|
|
|
|
" elixir
|
|
|
|
au BufRead,BufNewFile *.ex,*.exs call s:setf('elixir')
|
|
|
|
au BufRead,BufNewFile *.eex call s:setf('eelixir')
|
|
|
|
|
|
|
|
" fish
|
|
|
|
autocmd BufRead,BufNewFile *.fish setfiletype fish
|
|
|
|
autocmd BufRead fish_funced_*_*.fish call search('^$')
|
|
|
|
autocmd BufRead,BufNewFile ~/.config/fish/fish_{read_,}history setfiletype yaml
|
|
|
|
autocmd BufRead,BufNewFile ~/.config/fish/fishd.* setlocal readonly
|
|
|
|
autocmd BufNewFile ~/.config/fish/functions/*.fish
|
|
|
|
\ call append(0, ['function '.expand('%:t:r'),
|
|
|
|
\'',
|
|
|
|
\'end']) |
|
|
|
|
\ 2
|
|
|
|
|
|
|
|
" git
|
|
|
|
autocmd BufNewFile,BufRead *.git/{,modules/**/,worktrees/*/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
|
|
|
autocmd BufNewFile,BufRead *.git/config,.gitconfig,gitconfig,.gitmodules set ft=gitconfig
|
|
|
|
autocmd BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
|
|
|
autocmd BufNewFile,BufRead *.git/modules/**/config set ft=gitconfig
|
|
|
|
autocmd BufNewFile,BufRead git-rebase-todo set ft=gitrebase
|
|
|
|
autocmd BufNewFile,BufRead .gitsendemail.* set ft=gitsendemail
|
|
|
|
|
|
|
|
" plantuml
|
2018-12-26 04:46:44 -05:00
|
|
|
autocmd BufRead,BufNewFile *.pu,*.uml,*.plantuml,*.puml setfiletype plantuml | set filetype=plantuml
|
2018-01-10 17:54:03 -05:00
|
|
|
|
|
|
|
" scala
|
|
|
|
au BufRead,BufNewFile *.scala,*.sc set filetype=scala
|
|
|
|
au BufRead,BufNewFile *.sbt setfiletype sbt.scala
|
|
|
|
|
|
|
|
" swift
|
|
|
|
autocmd BufNewFile,BufRead *.swift set filetype=swift
|
2019-03-04 03:52:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
"jinja
|
|
|
|
autocmd BufNewFile,BufRead *.jinja2,*.j2,*.jinja,*.nunjucks,*.nunjs,*.njk set ft=jinja
|
2017-12-30 09:53:17 -05:00
|
|
|
augroup END
|
2018-01-10 17:54:03 -05:00
|
|
|
|
2018-05-10 12:59:56 -04:00
|
|
|
" Fix for https://github.com/sheerun/vim-polyglot/issues/236#issuecomment-387984954
|
|
|
|
if (!exists('g:graphql_javascript_tags'))
|
|
|
|
let g:graphql_javascript_tags = ['gql', 'graphql', 'Relay.QL']
|
|
|
|
endif
|