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-05 04:00:59 -04:00
|
|
|
" ftdetect/ansible.vim
|
2015-12-17 04:48:07 -05:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ansible') == -1
|
|
|
|
|
2016-05-02 04:42:37 -04:00
|
|
|
function! s:isAnsible()
|
2015-12-17 04:48:07 -05:00
|
|
|
let filepath = expand("%:p")
|
|
|
|
let filename = expand("%:t")
|
2016-05-02 04:42:37 -04:00
|
|
|
if filepath =~ '\v/(tasks|roles|handlers)/.*\.ya?ml$' | return 1 | en
|
|
|
|
if filepath =~ '\v/(group|host)_vars/' | return 1 | en
|
|
|
|
if filename =~ '\v(playbook|site|main|local)\.ya?ml$' | return 1 | en
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-02 04:42:37 -04:00
|
|
|
let shebang = getline(1)
|
|
|
|
if shebang =~# '^#!.*/bin/env\s\+ansible-playbook\>' | return 1 | en
|
|
|
|
if shebang =~# '^#!.*/bin/ansible-playbook\>' | return 1 | en
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-02 04:42:37 -04:00
|
|
|
return 0
|
2015-12-17 04:48:07 -05:00
|
|
|
endfunction
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-02 04:42:37 -04:00
|
|
|
:au BufNewFile,BufRead * if s:isAnsible() | set ft=ansible | en
|
2015-12-17 04:48:07 -05:00
|
|
|
:au BufNewFile,BufRead *.j2 set ft=ansible_template
|
|
|
|
:au BufNewFile,BufRead hosts set ft=ansible_hosts
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-12-17 04:48:07 -05:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/arduino.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'arduino') == -1
|
|
|
|
|
2013-09-16 10:53:38 -04:00
|
|
|
au BufRead,BufNewFile *.ino,*.pde set filetype=arduino
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/blade.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'blade') == -1
|
|
|
|
|
2016-01-22 03:08:00 -05:00
|
|
|
autocmd BufNewFile,BufRead *.blade.php set filetype=blade
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/cjsx.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cjsx') == -1
|
|
|
|
|
2015-07-18 16:54:07 -04:00
|
|
|
augroup CJSX
|
|
|
|
au!
|
|
|
|
autocmd BufNewFile,BufRead *.csx,*.cjsx set filetype=coffee
|
|
|
|
augroup END
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/clojure.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'clojure') == -1
|
|
|
|
|
2015-07-18 15:29:35 -04:00
|
|
|
autocmd BufNewFile,BufRead *.clj,*.cljs,*.edn,*.cljx,*.cljc setlocal filetype=clojure
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/coffee.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'coffee-script') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Language: CoffeeScript
|
|
|
|
" Maintainer: Mick Koch <mick@kochm.co>
|
|
|
|
" URL: http://github.com/kchmck/vim-coffee-script
|
|
|
|
" License: WTFPL
|
|
|
|
|
2013-09-16 10:53:38 -04:00
|
|
|
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
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2013-09-16 10:53:38 -04:00
|
|
|
function! s:DetectCoffee()
|
|
|
|
if getline(1) =~ '^#!.*\<coffee\>'
|
|
|
|
set filetype=coffee
|
|
|
|
endif
|
|
|
|
endfunction
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2013-09-16 10:53:38 -04:00
|
|
|
autocmd BufNewFile,BufRead * call s:DetectCoffee()
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/cql.vim
|
2015-12-28 08:58:35 -05:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cql') == -1
|
|
|
|
|
|
|
|
if has("autocmd")
|
|
|
|
au BufNewFile,BufRead *.cql set filetype=cql
|
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-12-28 08:58:35 -05:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/cryptol.vim
|
2016-05-02 04:44:59 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cryptol') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Copyright © 2013 Edward O'Callaghan. All Rights Reserved.
|
|
|
|
" Normal Cryptol Program;
|
2016-05-02 04:44:59 -04:00
|
|
|
au! BufRead,BufNewFile *.cry set filetype=cryptol
|
|
|
|
au! BufRead,BufNewFile *.cyl set filetype=cryptol
|
2016-07-05 04:00:59 -04:00
|
|
|
" Literate Cryptol Program;
|
2016-05-02 04:44:59 -04:00
|
|
|
au! BufRead,BufNewFile *.lcry set filetype=cryptol
|
|
|
|
au! BufRead,BufNewFile *.lcyl set filetype=cryptol
|
2016-07-05 04:00:59 -04:00
|
|
|
" Also in LaTeX *.tex which is outside our coverage scope.
|
|
|
|
|
2016-05-02 04:44:59 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/crystal.vim
|
2016-05-02 04:49:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'crystal') == -1
|
|
|
|
|
|
|
|
autocmd BufNewFile,BufReadPost *.cr setlocal filetype=crystal
|
|
|
|
autocmd BufNewFile,BufReadPost Projectfile setlocal filetype=crystal
|
|
|
|
autocmd BufNewFile,BufReadPost *.ecr setlocal filetype=eruby
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-02 04:49:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/cucumber.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Cucumber
|
2013-09-16 10:53:38 -04:00
|
|
|
autocmd BufNewFile,BufReadPost *.feature,*.story set filetype=cucumber
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/dart.vim
|
2015-12-06 05:38:02 -05:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dart') == -1
|
|
|
|
|
|
|
|
autocmd BufRead,BufNewFile *.dart set filetype=dart
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-12-06 05:38:02 -05:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/dockerfile.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'dockerfile') == -1
|
|
|
|
|
2013-09-26 06:48:01 -04:00
|
|
|
au BufNewFile,BufRead Dockerfile set filetype=dockerfile
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/elixir.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elixir') == -1
|
|
|
|
|
2016-01-22 03:08:00 -05:00
|
|
|
au BufRead,BufNewFile *.ex,*.exs call s:setf('elixir')
|
|
|
|
au BufRead,BufNewFile *.eex call s:setf('eelixir')
|
2016-05-02 04:42:37 -04:00
|
|
|
au BufRead,BufNewFile * call s:DetectElixir()
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-01-22 03:08:00 -05:00
|
|
|
au FileType elixir,eelixir setl sw=2 sts=2 et iskeyword+=!,?
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-01-22 03:08:00 -05:00
|
|
|
function! s:setf(filetype) abort
|
|
|
|
let &filetype = a:filetype
|
|
|
|
endfunction
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2014-11-10 20:37:21 -05:00
|
|
|
function! s:DetectElixir()
|
2016-01-22 03:08:00 -05:00
|
|
|
if getline(1) =~ '^#!.*\<elixir\>'
|
|
|
|
call s:setf('elixir')
|
|
|
|
endif
|
2014-11-10 20:37:21 -05:00
|
|
|
endfunction
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/elm.vim
|
2015-12-06 05:53:26 -05:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'elm') == -1
|
|
|
|
|
|
|
|
au BufNewFile,BufRead *.elm set filetype=elm
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-12-06 05:53:26 -05:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/ember-script.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emberscript') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Language: ember-script
|
|
|
|
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>>
|
|
|
|
" URL: http://github.com/yalesov/vim-ember-script
|
2016-07-19 04:09:54 -04:00
|
|
|
" Version: 1.0.4
|
|
|
|
" Last Change: 2016 Jul 6
|
|
|
|
" License: ISC
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-07-05 03:53:49 -04:00
|
|
|
if !exists('g:vim_ember_script')
|
|
|
|
let g:vim_ember_script = 1
|
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2014-04-14 19:14:47 -04:00
|
|
|
autocmd BufNewFile,BufRead *.em set filetype=ember-script
|
|
|
|
autocmd FileType ember-script set tabstop=2|set shiftwidth=2|set expandtab
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/emblem.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'emblem') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Language: emblem
|
|
|
|
" Maintainer: Yulij Andreevich Lesov <yalesov@gmail.com>
|
|
|
|
" URL: http://github.com/yalesov/vim-emblem
|
2016-07-19 04:09:54 -04:00
|
|
|
" Version: 2.0.1
|
|
|
|
" Last Change: 2016 Jul 6
|
|
|
|
" License: ISC
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-07-05 03:53:49 -04:00
|
|
|
if !exists('g:vim_emblem')
|
|
|
|
let g:vim_emblem = 1
|
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-07-05 03:53:49 -04:00
|
|
|
if exists('g:vim_ember_script')
|
|
|
|
autocmd BufNewFile,BufRead *.emblem set filetype=emblem
|
|
|
|
else
|
|
|
|
autocmd BufNewFile,BufRead *.em,*.emblem set filetype=emblem
|
|
|
|
endif
|
2014-08-12 18:03:22 -04:00
|
|
|
autocmd FileType emblem set tabstop=2|set shiftwidth=2|set expandtab
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/erlang.vim
|
2015-10-18 10:13:43 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'erlang') == -1
|
|
|
|
|
|
|
|
au BufNewFile,BufRead *.erl,*.hrl,rebar.config,*.app,*.app.src,*.yaws,*.xrl set ft=erlang
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-10-18 10:13:43 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/fish.vim
|
2016-05-02 04:46:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'fish') == -1
|
|
|
|
|
|
|
|
autocmd BufRead,BufNewFile *.fish setfiletype fish
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Detect fish scripts by the shebang line.
|
2016-05-02 04:46:45 -04:00
|
|
|
autocmd BufRead *
|
|
|
|
\ if getline(1) =~# '\v^#!%(\f*/|/usr/bin/env\s*<)fish>' |
|
|
|
|
\ setlocal filetype=fish |
|
|
|
|
\ endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Move cursor to first empty line when using funced.
|
2016-05-02 04:46:45 -04:00
|
|
|
autocmd BufRead fish_funced_*_*.fish call search('^$')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Fish histories are YAML documents.
|
2016-05-02 04:46:45 -04:00
|
|
|
autocmd BufRead,BufNewFile ~/.config/fish/fish_{read_,}history setfiletype yaml
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Universal variable storages should not be hand edited.
|
2016-05-02 04:46:45 -04:00
|
|
|
autocmd BufRead,BufNewFile ~/.config/fish/fishd.* setlocal readonly
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Mimic `funced` when manually creating functions.
|
2016-05-02 04:46:45 -04:00
|
|
|
autocmd BufNewFile ~/.config/fish/functions/*.fish
|
|
|
|
\ call append(0, ['function '.expand('%:t:r'),
|
|
|
|
\'',
|
|
|
|
\'end']) |
|
|
|
|
\ 2
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-02 04:46:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/git.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Git
|
2015-10-10 10:56:22 -04:00
|
|
|
autocmd BufNewFile,BufRead *.git/{,modules/**/,worktrees/*/}{COMMIT_EDIT,TAG_EDIT,MERGE_,}MSG set ft=gitcommit
|
2015-01-23 15:09:23 -05:00
|
|
|
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
|
2013-09-16 10:53:38 -04:00
|
|
|
autocmd BufNewFile,BufRead *.git/**
|
|
|
|
\ if getline(1) =~ '^\x\{40\}\>\|^ref: ' |
|
|
|
|
\ set ft=git |
|
|
|
|
\ endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" This logic really belongs in scripts.vim
|
2013-09-16 10:53:38 -04:00
|
|
|
autocmd BufNewFile,BufRead,StdinReadPost *
|
|
|
|
\ if getline(1) =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$' |
|
|
|
|
\ set ft=git |
|
|
|
|
\ endif
|
2014-07-29 07:03:49 -04:00
|
|
|
autocmd BufNewFile,BufRead *
|
|
|
|
\ if getline(1) =~ '^From \x\{40\} Mon Sep 17 00:00:00 2001$' |
|
|
|
|
\ set filetype=gitsendemail |
|
|
|
|
\ endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/glsl.vim
|
2015-10-10 11:15:29 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'glsl') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Language: OpenGL Shading Language
|
|
|
|
" Maintainer: Sergey Tikhomirov <sergey@tikhomirov.io>
|
|
|
|
|
2015-10-10 11:15:29 -04:00
|
|
|
autocmd! BufNewFile,BufRead *.glsl,*.geom,*.vert,*.frag,*.gsh,*.vsh,*.fsh,*.vs,*.fs,*.gs,*.tcs,*.tes set filetype=glsl
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" vim:set sts=2 sw=2 :
|
|
|
|
|
2015-10-10 11:15:29 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/gofiletype.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'go') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" We take care to preserve the user's fileencodings and fileformats,
|
|
|
|
" because those settings are global (not buffer local), yet we want
|
|
|
|
" to override them for loading Go files, which are defined to be UTF-8.
|
2014-08-12 18:55:50 -04:00
|
|
|
let s:current_fileformats = ''
|
|
|
|
let s:current_fileencodings = ''
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" define fileencodings to open as utf-8 encoding even if it's ascii.
|
2016-01-22 03:08:00 -05:00
|
|
|
function! s:gofiletype_pre(type)
|
2016-06-26 12:03:28 -04:00
|
|
|
let s:current_fileformats = &g:fileformats
|
|
|
|
let s:current_fileencodings = &g:fileencodings
|
|
|
|
set fileencodings=utf-8 fileformats=unix
|
|
|
|
let &l:filetype = a:type
|
2014-08-12 18:55:50 -04:00
|
|
|
endfunction
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" restore fileencodings as others
|
2014-08-12 18:55:50 -04:00
|
|
|
function! s:gofiletype_post()
|
2016-06-26 12:03:28 -04:00
|
|
|
let &g:fileformats = s:current_fileformats
|
|
|
|
let &g:fileencodings = s:current_fileencodings
|
2014-08-12 18:55:50 -04:00
|
|
|
endfunction
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-10-10 10:56:22 -04:00
|
|
|
au BufNewFile *.go setfiletype go | setlocal fileencoding=utf-8 fileformat=unix
|
2016-01-22 03:08:00 -05:00
|
|
|
au BufRead *.go call s:gofiletype_pre("go")
|
2014-08-12 18:55:50 -04:00
|
|
|
au BufReadPost *.go call s:gofiletype_post()
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-01-22 03:08:00 -05:00
|
|
|
au BufNewFile *.s setfiletype asm | setlocal fileencoding=utf-8 fileformat=unix
|
|
|
|
au BufRead *.s call s:gofiletype_pre("asm")
|
|
|
|
au BufReadPost *.s call s:gofiletype_post()
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-05-11 09:05:13 -04:00
|
|
|
au BufRead,BufNewFile *.tmpl set filetype=gohtmltmpl
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" vim: sw=2 ts=2 et
|
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/haml.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haml') == -1
|
|
|
|
|
2014-04-14 19:05:44 -04:00
|
|
|
autocmd BufNewFile,BufRead *.haml,*.hamlbars,*.hamlc setf haml
|
2013-09-16 10:53:38 -04:00
|
|
|
autocmd BufNewFile,BufRead *.sass setf sass
|
|
|
|
autocmd BufNewFile,BufRead *.scss setf scss
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/haskell.vim
|
2015-10-18 10:08:51 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haskell') == -1
|
|
|
|
|
|
|
|
au BufRead,BufNewFile *.hsc set filetype=haskell
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-10-18 10:08:51 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/haxe.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'haxe') == -1
|
|
|
|
|
2014-06-08 07:22:29 -04:00
|
|
|
autocmd BufNewFile,BufRead *.hx setf haxe
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/jasmine.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jasmine') == -1
|
|
|
|
|
2014-04-14 19:12:18 -04:00
|
|
|
autocmd BufNewFile,BufRead *Spec.js,*_spec.js set filetype=jasmine.javascript syntax=jasmine
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/javascript.vim
|
2016-05-03 06:56:11 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'javascript') == -1
|
|
|
|
|
|
|
|
au BufNewFile,BufRead *.js setf javascript
|
|
|
|
au BufNewFile,BufRead *.jsm setf javascript
|
|
|
|
au BufNewFile,BufRead Jakefile setf javascript
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-03 06:56:11 -04:00
|
|
|
fun! s:SelectJavascript()
|
2016-05-30 19:53:12 -04:00
|
|
|
if getline(1) =~# '^#!.*/bin/\%(env\s\+\)\?node\>'
|
2016-05-03 06:56:11 -04:00
|
|
|
set ft=javascript
|
|
|
|
endif
|
|
|
|
endfun
|
|
|
|
au BufNewFile,BufRead * call s:SelectJavascript()
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-03 06:56:11 -04:00
|
|
|
endif
|
2015-12-06 05:31:38 -05:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jsx') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
" Vim ftdetect file
|
|
|
|
"
|
|
|
|
" Language: JSX (JavaScript)
|
|
|
|
" Maintainer: Max Wang <mxawng@gmail.com>
|
|
|
|
"
|
|
|
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
|
|
|
|
|
|
" Whether the .jsx extension is required.
|
2015-12-06 05:31:38 -05:00
|
|
|
if !exists('g:jsx_ext_required')
|
|
|
|
let g:jsx_ext_required = 1
|
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Whether the @jsx pragma is required.
|
2015-12-06 05:31:38 -05:00
|
|
|
if !exists('g:jsx_pragma_required')
|
|
|
|
let g:jsx_pragma_required = 0
|
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-12-06 05:31:38 -05:00
|
|
|
if g:jsx_pragma_required
|
|
|
|
" Look for the @jsx pragma. It must be included in a docblock comment before
|
|
|
|
" anything else in the file (except whitespace).
|
|
|
|
let s:jsx_pragma_pattern = '\%^\_s*\/\*\*\%(\_.\%(\*\/\)\@!\)*@jsx\_.\{-}\*\/'
|
|
|
|
let b:jsx_pragma_found = search(s:jsx_pragma_pattern, 'npw')
|
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Whether to set the JSX filetype on *.js files.
|
2015-12-06 05:31:38 -05:00
|
|
|
fu! <SID>EnableJSX()
|
|
|
|
if g:jsx_pragma_required && !b:jsx_pragma_found | return 0 | endif
|
|
|
|
if g:jsx_ext_required && !exists('b:jsx_ext_found') | return 0 | endif
|
|
|
|
return 1
|
|
|
|
endfu
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-12-06 05:31:38 -05:00
|
|
|
autocmd BufNewFile,BufRead *.jsx let b:jsx_ext_found = 1
|
|
|
|
autocmd BufNewFile,BufRead *.jsx set filetype=javascript.jsx
|
|
|
|
autocmd BufNewFile,BufRead *.js
|
|
|
|
\ if <SID>EnableJSX() | set filetype=javascript.jsx | endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-12-06 05:31:38 -05:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/json.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'json') == -1
|
|
|
|
|
2013-09-16 10:53:38 -04:00
|
|
|
autocmd BufNewFile,BufRead *.json set filetype=json
|
2015-03-09 00:50:10 -04:00
|
|
|
autocmd BufNewFile,BufRead *.jsonp set filetype=json
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/jst.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jst') == -1
|
|
|
|
|
2015-05-11 09:05:13 -04:00
|
|
|
au BufNewFile,BufRead *.ejs set filetype=jst
|
|
|
|
au BufNewFile,BufRead *.jst set filetype=jst
|
|
|
|
au BufNewFile,BufRead *.djs set filetype=jst
|
2013-09-16 10:53:38 -04:00
|
|
|
au BufNewFile,BufRead *.hamljs set filetype=jst
|
2015-02-11 14:27:11 -05:00
|
|
|
au BufNewFile,BufRead *.ect set filetype=jst
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/julia.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'julia') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" NOTE: this line fixes an issue with the default system-wide lisp ftplugin
|
|
|
|
" which doesn't define b:undo_ftplugin
|
|
|
|
" (*.jt files are recognized as lisp)
|
2015-06-11 11:02:51 -04:00
|
|
|
au BufRead,BufNewFile *.jl let b:undo_ftplugin = "setlocal comments< define< formatoptions< iskeyword< lisp<"
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-06-11 11:02:51 -04:00
|
|
|
au BufRead,BufNewFile *.jl set filetype=julia
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/kotlin.vim
|
2015-10-10 11:15:29 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'kotlin') == -1
|
|
|
|
|
|
|
|
autocmd BufNewFile,BufRead *.kt setfiletype kotlin
|
|
|
|
autocmd BufNewFile,BufRead *.kts setfiletype kotlin
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-10-10 11:15:29 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/less.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'less') == -1
|
|
|
|
|
2013-09-16 10:53:38 -04:00
|
|
|
autocmd BufNewFile,BufRead *.less setf less
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/liquid.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'liquid') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Liquid
|
2014-06-08 13:38:42 -04:00
|
|
|
au BufNewFile,BufRead *.liquid set ft=liquid
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2014-06-08 13:38:42 -04:00
|
|
|
au BufNewFile,BufRead */_layouts/*.html,*/_includes/*.html set ft=liquid
|
|
|
|
au BufNewFile,BufRead *.html,*.xml,*.textile
|
|
|
|
\ if getline(1) == '---' | set ft=liquid | endif
|
|
|
|
au BufNewFile,BufRead *.markdown,*.mkd,*.mkdn,*.md
|
|
|
|
\ if getline(1) == '---' |
|
|
|
|
\ let b:liquid_subtype = 'markdown' |
|
|
|
|
\ set ft=liquid |
|
|
|
|
\ endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Set subtype for Shopify alternate templates
|
2014-06-08 13:38:42 -04:00
|
|
|
au BufNewFile,BufRead */templates/**.liquid,*/layout/**.liquid,*/snippets/**.liquid
|
|
|
|
\ let b:liquid_subtype = 'html' |
|
|
|
|
\ set ft=liquid |
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/mako.vim
|
2016-05-13 09:56:51 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'mako') == -1
|
|
|
|
|
|
|
|
au BufRead,BufNewFile *.mako set filetype=mako
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-13 09:56:51 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/markdown.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'markdown') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" markdown filetype file
|
2016-06-26 12:13:30 -04:00
|
|
|
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=markdown
|
|
|
|
au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} set filetype=markdown
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/mason-in-html.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Highlight .html files as Mason if they start with Mason tags
|
2013-11-06 17:55:01 -05:00
|
|
|
autocmd BufRead *.html
|
|
|
|
\ if getline(1) =~ '^\(%\|<[%&].*>\)' |
|
|
|
|
\ set filetype=mason |
|
|
|
|
\ endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/mustache.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'handlebars') == -1
|
|
|
|
|
2014-02-04 13:15:58 -05:00
|
|
|
if has("autocmd")
|
2014-11-10 20:37:21 -05:00
|
|
|
au BufNewFile,BufRead *.mustache,*.hogan,*.hulk,*.hjs set filetype=html.mustache syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
|
|
|
|
au BufNewFile,BufRead *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache | runtime! ftplugin/mustache.vim ftplugin/mustache*.vim ftplugin/mustache/*.vim
|
2014-02-04 13:15:58 -05:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/nginx.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nginx') == -1
|
|
|
|
|
2015-12-06 05:45:35 -05:00
|
|
|
au BufRead,BufNewFile *.nginx set ft=nginx
|
|
|
|
au BufRead,BufNewFile */etc/nginx/* set ft=nginx
|
|
|
|
au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx
|
|
|
|
au BufRead,BufNewFile nginx.conf set ft=nginx
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/nim.vim
|
2016-01-22 03:08:30 -05:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nim') == -1
|
|
|
|
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead *.nim,*.nims set filetype=nim
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
|
2016-01-22 03:08:30 -05:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/nix.vim
|
2015-12-17 04:47:00 -05:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'nix') == -1
|
|
|
|
|
|
|
|
autocmd BufNewFile,BufRead *.nix setfiletype nix
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-12-17 04:47:00 -05:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/opencl.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'opencl') == -1
|
|
|
|
|
2015-12-06 05:31:38 -05:00
|
|
|
au! BufRead,BufNewFile *.cl set filetype=opencl
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/perl11.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'perl') == -1
|
|
|
|
|
2014-07-29 07:03:49 -04:00
|
|
|
function! s:DetectPerl6()
|
|
|
|
let line_no = 1
|
|
|
|
let eof = line('$')
|
|
|
|
let in_pod = 0
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2014-07-29 07:03:49 -04:00
|
|
|
while line_no <= eof
|
|
|
|
let line = getline(line_no)
|
|
|
|
let line_no = line_no + 1
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2014-07-29 07:03:49 -04:00
|
|
|
if line =~ '^=\w'
|
|
|
|
let in_pod = 1
|
|
|
|
elseif line =~ '^=\%(end\|cut\)'
|
|
|
|
let in_pod = 0
|
|
|
|
elseif !in_pod
|
|
|
|
let line = substitute(line, '#.*', '', '')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2014-07-29 07:03:49 -04:00
|
|
|
if line =~ '^\s*$'
|
|
|
|
continue
|
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2014-07-29 07:03:49 -04:00
|
|
|
if line =~ '^\s*\%(use\s\+\)\=v6\%(\.\d\%(\.\d\)\=\)\=;'
|
|
|
|
set filetype=perl6 " we matched a 'use v6' declaration
|
2015-05-24 17:42:59 -04:00
|
|
|
elseif line =~ '^\s*\%(\%(my\|our\)\s\+\)\=\%(unit\s\+\)\=\(module\|class\|role\|enum\|grammar\)'
|
2014-07-29 07:03:49 -04:00
|
|
|
set filetype=perl6 " we found a class, role, module, enum, or grammar declaration
|
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2014-07-29 07:03:49 -04:00
|
|
|
break " we either found what we needed, or we found a non-POD, non-comment,
|
|
|
|
" non-Perl 6 indicating line, so bail out
|
|
|
|
endif
|
|
|
|
endwhile
|
|
|
|
endfunction
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2014-07-29 07:03:49 -04:00
|
|
|
autocmd BufReadPost *.pl,*.pm,*.t call s:DetectPerl6()
|
2015-03-09 00:32:50 -04:00
|
|
|
autocmd BufNew,BufNewFile,BufRead *.nqp setf perl6
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/pgsql.vim
|
2016-05-02 04:52:01 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pgsql') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" postgreSQL
|
2016-05-02 04:52:01 -04:00
|
|
|
au BufNewFile,BufRead *.pgsql setf pgsql
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-02 04:52:01 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/plantuml.vim
|
2016-05-02 04:50:59 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'plantuml') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Vim ftdetect file
|
|
|
|
" Language: PlantUML
|
|
|
|
" Maintainer: Aaron C. Meadows < language name at shadowguarddev dot com>
|
|
|
|
" Last Change: 19-Jun-2012
|
|
|
|
" Version: 0.1
|
|
|
|
|
2016-05-02 04:50:59 -04:00
|
|
|
if did_filetype()
|
|
|
|
finish
|
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-30 19:53:12 -04:00
|
|
|
autocmd BufRead,BufNewFile * :if getline(1) =~ '^.*startuml.*$'| setfiletype plantuml | set filetype=plantuml | endif
|
|
|
|
autocmd BufRead,BufNewFile *.pu,*.uml,*.plantuml setfiletype plantuml | set filetype=plantuml
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-02 04:50:59 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/proto.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'protobuf') == -1
|
|
|
|
|
2013-09-16 10:53:38 -04:00
|
|
|
autocmd BufNewFile,BufRead *.proto setfiletype proto
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/ps1.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Vim ftdetect plugin file
|
|
|
|
" Language: Windows PowerShell
|
|
|
|
" Maintainer: Peter Provost <peter@provost.org>
|
|
|
|
" Version: 2.10
|
|
|
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
|
|
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
|
|
|
|
"
|
2014-12-11 17:16:49 -05:00
|
|
|
au BufNewFile,BufRead *.ps1 set ft=ps1
|
|
|
|
au BufNewFile,BufRead *.psd1 set ft=ps1
|
|
|
|
au BufNewFile,BufRead *.psm1 set ft=ps1
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/ps1xml.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'powershell') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Vim ftdetect plugin file
|
|
|
|
" Language: Windows PowerShell
|
|
|
|
" Maintainer: Peter Provost <peter@provost.org>
|
|
|
|
" Version: 2.10
|
|
|
|
" Project Repository: https://github.com/PProvost/vim-ps1
|
|
|
|
" Vim Script Page: http://www.vim.org/scripts/script.php?script_id=1327
|
|
|
|
|
2014-12-11 17:16:49 -05:00
|
|
|
au BufNewFile,BufRead *.ps1xml set ft=ps1xml
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/pug.vim
|
2016-05-02 05:52:54 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pug') == -1
|
2016-05-02 04:42:37 -04:00
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Pug
|
2016-05-02 04:42:37 -04:00
|
|
|
autocmd BufNewFile,BufReadPost *.pug set filetype=pug
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Jade
|
2016-05-02 04:42:37 -04:00
|
|
|
autocmd BufNewFile,BufReadPost *.jade set filetype=pug
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-02 04:42:37 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/puppet.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'puppet') == -1
|
|
|
|
|
2014-04-14 19:26:34 -04:00
|
|
|
au! BufRead,BufNewFile *.pp setfiletype puppet
|
2014-08-12 17:45:36 -04:00
|
|
|
au! BufRead,BufNewFile Puppetfile setfiletype ruby
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/purescript.vim
|
2016-05-02 05:35:06 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'purescript') == -1
|
|
|
|
|
|
|
|
au BufNewFile,BufRead *.purs setf purescript
|
|
|
|
au FileType purescript let &l:commentstring='{--%s--}'
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-02 05:35:06 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/qml.vim
|
2015-10-10 11:25:38 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'qml') == -1
|
|
|
|
|
|
|
|
autocmd BufRead,BufNewFile *.qml setfiletype qml
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-10-10 11:25:38 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/ruby.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Officially distributed filetypes
|
|
|
|
|
|
|
|
" Support functions {{{
|
2014-04-14 19:05:44 -04:00
|
|
|
function! s:setf(filetype) abort
|
|
|
|
if &filetype !=# a:filetype
|
|
|
|
let &filetype = a:filetype
|
|
|
|
endif
|
|
|
|
endfunction
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2016-05-30 19:53:12 -04:00
|
|
|
func! s:StarSetf(ft)
|
|
|
|
if expand("<amatch>") !~ g:ft_ignore_pat
|
|
|
|
exe 'setf ' . a:ft
|
|
|
|
endif
|
|
|
|
endfunc
|
2016-07-05 04:00:59 -04:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" HTML with Ruby - eRuby
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead *.erb,*.rhtml call s:setf('eruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Interactive Ruby shell
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead .irbrc,irbrc call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Ruby
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead *.rb,*.rbw,*.gemspec call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Rackup
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead *.ru call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Bundler
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead Gemfile call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Ruby on Rails
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead *.builder,*.rxml,*.rjs,*.ruby call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Rakefile
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead [rR]akefile,*.rake call s:setf('ruby')
|
|
|
|
au BufNewFile,BufRead [rR]akefile* call s:StarSetf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" TODO: does anyone still use Rantfiles? Remove for Vim 8?
|
|
|
|
" Rantfile
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead [rR]antfile,*.rant call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
|
|
|
|
2016-05-30 19:53:12 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/ruby_extra.vim
|
2016-05-30 19:53:12 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'ruby') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" All other filetypes
|
|
|
|
|
|
|
|
" Support functions {{{
|
2016-05-30 19:53:12 -04:00
|
|
|
function! s:setf(filetype) abort
|
|
|
|
if &filetype !=# a:filetype
|
|
|
|
let &filetype = a:filetype
|
|
|
|
endif
|
|
|
|
endfunction
|
2016-07-05 04:00:59 -04:00
|
|
|
" }}}
|
|
|
|
|
|
|
|
" Appraisal
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead Appraisals call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Autotest
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead .autotest call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Buildr Buildfile
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead [Bb]uildfile call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Capistrano
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead Capfile,*.cap call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Chef
|
2014-04-14 19:05:44 -04:00
|
|
|
au BufNewFile,BufRead Cheffile call s:setf('ruby')
|
|
|
|
au BufNewFile,BufRead Berksfile call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" CocoaPods
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead Podfile,*.podspec call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Guard
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead Guardfile,.Guardfile call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Jbuilder
|
2014-04-14 19:05:44 -04:00
|
|
|
au BufNewFile,BufRead *.jbuilder call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Kitchen Sink
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead KitchenSink call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Opal
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead *.opal call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Pry config
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead .pryrc call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Puppet librarian
|
2014-04-14 19:05:44 -04:00
|
|
|
au BufNewFile,BufRead Puppetfile call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Rabl
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead *.rabl call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Routefile
|
2015-10-10 10:56:22 -04:00
|
|
|
au BufNewFile,BufRead [rR]outefile call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" SimpleCov
|
2016-06-26 12:03:28 -04:00
|
|
|
au BufNewFile,BufRead .simplecov call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Thor
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead [tT]horfile,*.thor call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Vagrant
|
2016-05-30 19:53:12 -04:00
|
|
|
au BufNewFile,BufRead [vV]agrantfile call s:setf('ruby')
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/rust.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
|
|
|
|
2014-01-24 12:06:22 -05:00
|
|
|
au BufRead,BufNewFile *.rs set filetype=rust
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/sbt.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'sbt') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Vim detect file
|
|
|
|
" Language: sbt
|
|
|
|
" Maintainer: Derek Wyatt <derek@{myfirstname}{mylastname}.org>
|
|
|
|
" Last Change: 2012 Jan 19
|
|
|
|
|
2015-02-11 14:27:11 -05:00
|
|
|
au BufRead,BufNewFile *.sbt set filetype=sbt.scala
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/scala.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'scala') == -1
|
|
|
|
|
2013-09-16 10:53:38 -04:00
|
|
|
fun! s:DetectScala()
|
2015-03-09 00:32:50 -04:00
|
|
|
if getline(1) =~# '^#!\(/usr\)\?/bin/env\s\+scalas\?'
|
2013-09-16 10:53:38 -04:00
|
|
|
set filetype=scala
|
|
|
|
endif
|
|
|
|
endfun
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-02-11 14:27:11 -05:00
|
|
|
au BufRead,BufNewFile *.scala set filetype=scala
|
2013-09-16 10:53:38 -04:00
|
|
|
au BufRead,BufNewFile * call s:DetectScala()
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Install vim-sbt for additional syntax highlighting.
|
2015-02-11 14:27:11 -05:00
|
|
|
au BufRead,BufNewFile *.sbt setfiletype sbt.scala
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/slim.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'slim') == -1
|
|
|
|
|
2016-05-30 19:53:12 -04:00
|
|
|
autocmd BufNewFile,BufRead *.slim setf slim
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/solidity.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'solidity') == -1
|
|
|
|
|
2015-07-18 17:00:08 -04:00
|
|
|
au BufNewFile,BufRead *.sol setf solidity
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/stylus.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'stylus') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" Stylus
|
2013-09-16 10:53:38 -04:00
|
|
|
autocmd BufNewFile,BufReadPost *.styl set filetype=stylus
|
|
|
|
autocmd BufNewFile,BufReadPost *.stylus set filetype=stylus
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/swift.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'swift') == -1
|
|
|
|
|
2016-05-02 04:42:37 -04:00
|
|
|
autocmd BufNewFile,BufRead *.swift set filetype=swift
|
2015-12-06 05:31:38 -05:00
|
|
|
autocmd BufRead * call s:Swift()
|
|
|
|
function! s:Swift()
|
|
|
|
if !empty(&filetype)
|
|
|
|
return
|
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-12-06 05:31:38 -05:00
|
|
|
let line = getline(1)
|
|
|
|
if line =~ "^#!.*swift"
|
|
|
|
setfiletype swift
|
|
|
|
endif
|
|
|
|
endfunction
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/systemd.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'systemd') == -1
|
|
|
|
|
2014-06-08 07:57:13 -04:00
|
|
|
au BufNewFile,BufRead *.automount set filetype=systemd
|
|
|
|
au BufNewFile,BufRead *.mount set filetype=systemd
|
|
|
|
au BufNewFile,BufRead *.path set filetype=systemd
|
|
|
|
au BufNewFile,BufRead *.service set filetype=systemd
|
|
|
|
au BufNewFile,BufRead *.socket set filetype=systemd
|
|
|
|
au BufNewFile,BufRead *.swap set filetype=systemd
|
|
|
|
au BufNewFile,BufRead *.target set filetype=systemd
|
|
|
|
au BufNewFile,BufRead *.timer set filetype=systemd
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/textile.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'textile') == -1
|
|
|
|
|
2016-07-05 04:00:59 -04:00
|
|
|
" textile.vim
|
|
|
|
"
|
|
|
|
" Tim Harper (tim.theenchanter.com)
|
|
|
|
|
|
|
|
" Force filetype to be textile even if already set
|
|
|
|
" This will override the system ftplugin/changelog
|
|
|
|
" set on some distros
|
2013-09-16 10:53:38 -04:00
|
|
|
au BufRead,BufNewFile *.textile set filetype=textile
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/thrift.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'thrift') == -1
|
|
|
|
|
2014-12-11 17:02:50 -05:00
|
|
|
au BufNewFile,BufRead *.thrift setlocal filetype=thrift
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/tmux.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'tmux') == -1
|
|
|
|
|
2016-06-26 12:03:28 -04:00
|
|
|
autocmd BufNewFile,BufRead {.,}tmux*.conf* setfiletype tmux
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/toml.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'toml') == -1
|
|
|
|
|
2014-04-14 19:16:56 -04:00
|
|
|
autocmd BufNewFile,BufRead *.toml set filetype=toml
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" Rust uses Cargo.toml and Cargo.lock (both are toml files).
|
2015-01-23 15:09:23 -05:00
|
|
|
autocmd BufNewFile,BufRead Cargo.lock set filetype=toml
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/typescript.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
|
|
|
|
2015-10-10 10:56:22 -04:00
|
|
|
autocmd BufNewFile,BufRead *.ts,*.tsx setlocal filetype=typescript
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/vala.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vala') == -1
|
|
|
|
|
2014-12-11 17:09:07 -05:00
|
|
|
autocmd BufRead *.vala,*.vapi set efm=%f:%l.%c-%[%^:]%#:\ %t%[%^:]%#:\ %m
|
|
|
|
au BufRead,BufNewFile *.vala,*.vapi setfiletype vala
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/vcl.vim
|
2015-12-06 05:34:19 -05:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vcl') == -1
|
|
|
|
|
|
|
|
au BufRead,BufNewFile *.vcl set filetype=vcl
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-12-06 05:34:19 -05:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|
|
|
|
" ftdetect/velocity.vim
|
2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'vm') == -1
|
|
|
|
|
2014-12-22 16:01:38 -05:00
|
|
|
au BufRead,BufNewFile *.vm set ft=velocity syntax=velocity
|
2016-07-05 04:00:59 -04:00
|
|
|
|
2015-07-18 17:05:45 -04:00
|
|
|
endif
|
2016-07-05 04:00:59 -04:00
|
|
|
|