mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
1800 lines
55 KiB
VimL
1800 lines
55 KiB
VimL
" Please do not edit this file directly, instead modify polyglot.vim or scripts/build
|
|
|
|
" don't spam the user when Vim is started in Vi compatibility mode
|
|
let s:cpo_save = &cpo
|
|
set cpo&vim
|
|
|
|
" Disable all native vim ftdetect
|
|
if exists('g:polyglot_test')
|
|
autocmd!
|
|
endif
|
|
|
|
func! s:Observe(fn)
|
|
let b:polyglot_observe = a:fn
|
|
augroup polyglot-observer
|
|
au! CursorHold,CursorHoldI,BufWritePost <buffer>
|
|
\ execute('if polyglot#' . b:polyglot_observe . '() | au! polyglot-observer | endif')
|
|
augroup END
|
|
endfunc
|
|
|
|
let s:disabled_packages = {}
|
|
let s:new_polyglot_disabled = []
|
|
|
|
if exists('g:polyglot_disabled')
|
|
for pkg in g:polyglot_disabled
|
|
let base = split(pkg, '\.')
|
|
if len(base) > 0
|
|
let s:disabled_packages[pkg] = 1
|
|
call add(s:new_polyglot_disabled, base[0])
|
|
endif
|
|
endfor
|
|
else
|
|
let g:polyglot_disabled_not_set = 1
|
|
endif
|
|
|
|
function! s:SetDefault(name, value)
|
|
if !exists(a:name)
|
|
let {a:name} = a:value
|
|
endif
|
|
endfunction
|
|
|
|
call s:SetDefault('g:markdown_enable_spell_checking', 0)
|
|
call s:SetDefault('g:markdown_enable_input_abbreviations', 0)
|
|
call s:SetDefault('g:markdown_enable_mappings', 0)
|
|
|
|
" Enable jsx syntax by default
|
|
call s:SetDefault('g:jsx_ext_required', 0)
|
|
|
|
" Needed for sql highlighting
|
|
call s:SetDefault('g:javascript_sql_dialect', 'sql')
|
|
|
|
" Make csv loading faster
|
|
call s:SetDefault('g:csv_start', 1)
|
|
call s:SetDefault('g:csv_end', 2)
|
|
|
|
" Disable json concealing by default
|
|
call s:SetDefault('g:vim_json_syntax_conceal', 0)
|
|
|
|
call s:SetDefault('g:filetype_euphoria', 'elixir')
|
|
|
|
if !exists('g:python_highlight_all')
|
|
call s:SetDefault('g:python_highlight_builtins', 1)
|
|
call s:SetDefault('g:python_highlight_builtin_objs', 1)
|
|
call s:SetDefault('g:python_highlight_builtin_types', 1)
|
|
call s:SetDefault('g:python_highlight_builtin_funcs', 1)
|
|
call s:SetDefault('g:python_highlight_builtin_funcs_kwarg', 1)
|
|
call s:SetDefault('g:python_highlight_exceptions', 1)
|
|
call s:SetDefault('g:python_highlight_string_formatting', 1)
|
|
call s:SetDefault('g:python_highlight_string_format', 1)
|
|
call s:SetDefault('g:python_highlight_string_templates', 1)
|
|
call s:SetDefault('g:python_highlight_indent_errors', 1)
|
|
call s:SetDefault('g:python_highlight_space_errors', 1)
|
|
call s:SetDefault('g:python_highlight_doctests', 1)
|
|
call s:SetDefault('g:python_highlight_func_calls', 1)
|
|
call s:SetDefault('g:python_highlight_class_vars', 1)
|
|
call s:SetDefault('g:python_highlight_operators', 1)
|
|
call s:SetDefault('g:python_highlight_file_headers_as_comments', 1)
|
|
call s:SetDefault('g:python_slow_sync', 1)
|
|
endif
|
|
|
|
" We need it because scripts.vim in vim uses "set ft=" which cannot be
|
|
" overridden with setf (and we can't use set ft= so our scripts.vim work)
|
|
func! s:Setf(ft)
|
|
if &filetype !~# '\<'.a:ft.'\>'
|
|
let &filetype = a:ft
|
|
endif
|
|
endfunc
|
|
|
|
" Function used for patterns that end in a star: don't set the filetype if the
|
|
" file name matches ft_ignore_pat.
|
|
" When using this, the entry should probably be further down below with the
|
|
" other StarSetf() calls.
|
|
func! s:StarSetf(ft)
|
|
if expand("<amatch>") !~ g:ft_ignore_pat && &filetype !~# '\<'.a:ft.'\>'
|
|
let &filetype = a:ft
|
|
endif
|
|
endfunc
|
|
|
|
augroup filetypedetect
|
|
|
|
|
|
if !has_key(s:disabled_packages, '8th')
|
|
au! BufRead,BufNewFile *.8th
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'haproxy')
|
|
au! BufRead,BufNewFile *.cfg
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'a2ps')
|
|
au! BufRead,BufNewFile */etc/a2ps.cfg,*/etc/a2ps/*.cfg,a2psrc,.a2psrc
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'a65')
|
|
au! BufRead,BufNewFile *.a65
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'aap')
|
|
au! BufRead,BufNewFile *.aap
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'abap')
|
|
au! BufRead,BufNewFile *.abap
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'abc')
|
|
au! BufRead,BufNewFile *.abc
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'abel')
|
|
au! BufRead,BufNewFile *.abl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'acedb')
|
|
au! BufRead,BufNewFile *.wrm
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'acpiasl')
|
|
au! BufRead,BufNewFile *.dsl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ada')
|
|
au! BufRead,BufNewFile *.adb,*.ads,*.ada,*.adc,*.gpr,*.ada_m
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ahdl')
|
|
au! BufRead,BufNewFile *.tdf
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'aidl')
|
|
au! BufRead,BufNewFile *.aidl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'alsaconf')
|
|
au! BufRead,BufNewFile .asoundrc,*/usr/share/alsa/alsa.conf,*/etc/asound.conf
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'aml')
|
|
au! BufRead,BufNewFile *.aml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ampl')
|
|
au! BufRead,BufNewFile *.run
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'xml')
|
|
au! BufRead,BufNewFile *.csproj,*.ui,*.wsdl,*.wsf,*.xlf,*.xliff,*.xmi,*.xsd,*.xul,*.tpm,*.csproj.user,*.wpl,*/etc/blkid.tab,*/etc/blkid.tab.old,*/etc/xdg/menus/*.menu
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ant')
|
|
au! BufRead,BufNewFile build.xml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'apache')
|
|
au! BufRead,BufNewFile .htaccess,*/etc/httpd/*.conf,*/etc/apache2/sites-*/*.com,access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf*,*/etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf*
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'applescript')
|
|
au! BufRead,BufNewFile *.scpt
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'aptconf')
|
|
au! BufRead,BufNewFile apt.conf,*/.aptitude/config
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'arch')
|
|
au! BufRead,BufNewFile .arch-inventory,=tagging-method
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'c/c++')
|
|
au! BufRead,BufNewFile *.cpp,*.c++,*.cc,*.cxx,*.hh,*.hpp,*.hxx,*.inl,*.ipp,*.tcc,*.tpp,*.moc,*.tlh,*.qc,*enlightenment/*.cfg
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'arduino')
|
|
au! BufRead,BufNewFile *.pde,*.ino
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'art')
|
|
au! BufRead,BufNewFile *.art
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'asciidoc')
|
|
au! BufRead,BufNewFile *.asciidoc,*.adoc
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'autohotkey')
|
|
au! BufRead,BufNewFile *.ahk
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'elf')
|
|
au! BufRead,BufNewFile *.am
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'automake')
|
|
au! BufRead,BufNewFile GNUmakefile.am
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'asn')
|
|
au! BufRead,BufNewFile *.asn,*.asn1
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'atlas')
|
|
au! BufRead,BufNewFile *.atl,*.as
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'autoit')
|
|
au! BufRead,BufNewFile *.au3
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ave')
|
|
au! BufRead,BufNewFile *.ave
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'awk')
|
|
au! BufRead,BufNewFile *.awk,*.gawk
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'clojure')
|
|
au! BufRead,BufNewFile *.clj,*.cljc,*.cljs,*.cljx
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'cmake')
|
|
au! BufRead,BufNewFile *.cmake,*.cmake.in,CMakeLists.txt
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'cucumber')
|
|
au! BufRead,BufNewFile *.feature
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'dart')
|
|
au! BufRead,BufNewFile *.dart,*.drt
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'dlang')
|
|
au! BufRead,BufNewFile *.sdl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'dockerfile')
|
|
au! BufRead,BufNewFile *.Dockerfile,Dockerfile
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'elm')
|
|
au! BufRead,BufNewFile *.elm
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'erlang')
|
|
au! BufRead,BufNewFile *.erl,*.es,*.hrl,*.yaws
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'forth')
|
|
au! BufRead,BufNewFile *.fs,*.ft,*.fth
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'glsl')
|
|
au! BufRead,BufNewFile *.fs,*.gs,*.comp
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'fsharp')
|
|
au! BufRead,BufNewFile *.fs
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'git')
|
|
au! BufRead,BufNewFile .gitconfig,.gitmodules,*.git/config,*/.config/git/config,*.git/modules/*/config,git-rebase-todo
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'gnuplot')
|
|
au! BufRead,BufNewFile *.gp,*.gpi
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'go')
|
|
au! BufRead,BufNewFile *.go,*.tmpl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'javascript')
|
|
au! BufRead,BufNewFile *.js,*.cjs,*.es,*.gs,*.mjs,*.pac,*.javascript
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'jsx')
|
|
au! BufRead,BufNewFile *.jsx
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'groovy')
|
|
au! BufRead,BufNewFile *.groovy,*.gradle
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'grub')
|
|
au! BufRead,BufNewFile */boot/grub/menu.lst,*/boot/grub/grub.conf,*/etc/grub.conf
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'haml')
|
|
au! BufRead,BufNewFile *.haml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'handlebars')
|
|
au! BufRead,BufNewFile *.hb
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'haskell')
|
|
au! BufRead,BufNewFile *.hs,*.hs-boot,*.hsc
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'html5')
|
|
au! BufRead,BufNewFile *.st,*.xht,*.xhtml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'json')
|
|
au! BufRead,BufNewFile *.json,*.ice,*.webmanifest,*.yy,*.jsonp,Pipfile.lock
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'kotlin')
|
|
au! BufRead,BufNewFile *.kt,*.ktm,*.kts
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'less')
|
|
au! BufRead,BufNewFile *.less
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'llvm')
|
|
au! BufRead,BufNewFile *.ll
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'lua')
|
|
au! BufRead,BufNewFile *.lua,*.nse,*.rockspec
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'm4')
|
|
au! BufRead,BufNewFile *.m4,*.at
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'mathematica')
|
|
au! BufRead,BufNewFile *.cdf,*.nb
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'markdown')
|
|
au! BufRead,BufNewFile *.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'meson')
|
|
au! BufRead,BufNewFile meson.build,meson_options.txt
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ocaml')
|
|
au! BufRead,BufNewFile *.ml,*.mli,*.mll,*.mly,.ocamlinit
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'opencl')
|
|
au! BufRead,BufNewFile *.cl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'perl')
|
|
au! BufRead,BufNewFile *.al,*.plx,*.psgi,*.t,example.gitolite.rc,.gitolite.rc,*.pod,*.mason,*.mhtml,*.comp,*.xs
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'php')
|
|
au! BufRead,BufNewFile *.php,*.ctp,*.phtml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'protobuf')
|
|
au! BufRead,BufNewFile *.proto
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'puppet')
|
|
au! BufRead,BufNewFile *.pp
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'python')
|
|
au! BufRead,BufNewFile *.py,*.pyi,*.pyw,*.spec,*.ptl,SConstruct,.pythonrc,.pythonstartup
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'r-lang')
|
|
au! BufRead,BufNewFile *.s,*.S,*.rd
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'racket')
|
|
au! BufRead,BufNewFile *.rkt
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'raku')
|
|
au! BufRead,BufNewFile *.p6,*.pl6,*.pm6,*.t,*.raku,*.rakumod,*.pod6
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'raml')
|
|
au! BufRead,BufNewFile *.raml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'rst')
|
|
au! BufRead,BufNewFile *.rst
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ruby')
|
|
au! BufRead,BufNewFile *.rb,*.builder,*.gemspec,*.rake,*.rbw,*.ru,*.spec,*.rxml,*.rjs,*.rant,.irbrc,Gemfile,Rakefile,Rantfile,*.erb,*.rhtml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'rust')
|
|
au! BufRead,BufNewFile *.rs
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'scala')
|
|
au! BufRead,BufNewFile *.scala
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'sbt')
|
|
au! BufRead,BufNewFile *.sbt
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'scss')
|
|
au! BufRead,BufNewFile *.scss
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'sh')
|
|
au! BufRead,BufNewFile */etc/udev/cdsymlinks.conf,*.zsh,.zshrc,.zshenv,.zlogin,.zprofile,.zlogout,.zlog*,.zcompdump*,.zfbfmarks,.zsh*
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'smt2')
|
|
au! BufRead,BufNewFile *.smt
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'svg')
|
|
au! BufRead,BufNewFile *.svg
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'swift')
|
|
au! BufRead,BufNewFile *.swift
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'terraform')
|
|
au! BufRead,BufNewFile *.tf
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'tmux')
|
|
au! BufRead,BufNewFile .tmux*.conf
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'toml')
|
|
au! BufRead,BufNewFile Pipfile
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'twig')
|
|
au! BufRead,BufNewFile *.twig
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'typescript')
|
|
au! BufRead,BufNewFile *.ts,*.tsx
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'v')
|
|
au! BufRead,BufNewFile *.v
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'vbnet')
|
|
au! BufRead,BufNewFile *.vb
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'vmasm')
|
|
au! BufRead,BufNewFile *.mar
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'vue')
|
|
au! BufRead,BufNewFile *.vue
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'xsl')
|
|
au! BufRead,BufNewFile *.xslt,*.xsl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'yaml')
|
|
au! BufRead,BufNewFile *.yml,*.yaml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'help')
|
|
au! BufRead,BufNewFile $VIMRUNTIME/doc/*.txt
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'visual-basic')
|
|
au! BufRead,BufNewFile *.vba,*.vbs,*.dsm,*.ctl,*.sba
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'dosini')
|
|
au! BufRead,BufNewFile *.ini,*.properties,.editorconfig,.npmrc,*/etc/pacman.conf,php.ini-*,*/etc/yum.conf,*/etc/yum.repos.d/*
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'bzl')
|
|
au! BufRead,BufNewFile *.bzl,*.bazel,*.BUILD,BUILD,WORKSPACE
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'prolog')
|
|
au! BufRead,BufNewFile *.pdb
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'tads')
|
|
au! BufRead,BufNewFile *.t
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'sql')
|
|
au! BufRead,BufNewFile *.pls,*.pkb,*.pks,*.plsql,*.tyb,*.typ,*.tyc
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, '8th')
|
|
au BufNewFile,BufRead *.8th set ft=8th
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'haproxy')
|
|
au BufNewFile,BufRead *.cfg set ft=haproxy
|
|
au BufNewFile,BufRead haproxy*.c* call s:StarSetf('haproxy')
|
|
au BufNewFile,BufRead haproxy.cfg set ft=haproxy
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'a2ps')
|
|
au BufNewFile,BufRead */etc/a2ps.cfg set ft=a2ps
|
|
au BufNewFile,BufRead */etc/a2ps/*.cfg set ft=a2ps
|
|
au BufNewFile,BufRead {.,}a2psrc set ft=a2ps
|
|
au BufNewFile,BufRead a2psrc set ft=a2ps
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'a65')
|
|
au BufNewFile,BufRead *.a65 set ft=a65
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'aap')
|
|
au BufNewFile,BufRead *.aap set ft=aap
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'abap')
|
|
au BufNewFile,BufRead *.abap set ft=abap
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'abaqus')
|
|
au! BufNewFile,BufRead *.inp call polyglot#DetectInpFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'abc')
|
|
au BufNewFile,BufRead *.abc set ft=abc
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'abel')
|
|
au BufNewFile,BufRead *.abl set ft=abel
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'acedb')
|
|
au BufNewFile,BufRead *.wrm set ft=acedb
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'acpiasl')
|
|
au BufNewFile,BufRead *.asl,*.dsl set ft=asl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ada')
|
|
au BufNewFile,BufRead *.ada,*.ada_m,*.adb,*.adc,*.ads,*.gpr set ft=ada
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ahdl')
|
|
au BufNewFile,BufRead *.tdf set ft=ahdl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'aidl')
|
|
au BufNewFile,BufRead *.aidl set ft=aidl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'alsaconf')
|
|
au BufNewFile,BufRead */etc/asound.conf set ft=alsaconf
|
|
au BufNewFile,BufRead */usr/share/alsa/alsa.conf set ft=alsaconf
|
|
au BufNewFile,BufRead {.,}asoundrc set ft=alsaconf
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'aml')
|
|
au BufNewFile,BufRead *.aml set ft=aml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ampl')
|
|
au BufNewFile,BufRead *.run set ft=ampl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'xml')
|
|
au BufNewFile,BufRead *.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.cdxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.csproj.user,*.ct,*.depproj,*.dita,*.ditamap,*.ditaval,*.dll.config,*.dotsettings,*.filters,*.fsproj,*.fxml,*.glade,*.gml,*.gmx,*.grxml,*.gst,*.iml,*.ivy,*.jelly,*.jsproj,*.kml,*.launch,*.mdpolicy,*.mjml,*.mm,*.mod,*.mxml,*.natvis,*.ncl,*.ndproj,*.nproj,*.nuspec,*.odd,*.osm,*.pkgproj,*.pluginspec,*.proj,*.props,*.ps1xml,*.psc1,*.pt,*.rdf,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.tpm,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wpl,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml,*.xml.dist,*.xproj,*.xsd,*.xspec,*.xul,*.zcml set ft=xml
|
|
au BufNewFile,BufRead */etc/blkid.tab set ft=xml
|
|
au BufNewFile,BufRead */etc/blkid.tab.old set ft=xml
|
|
au BufNewFile,BufRead */etc/xdg/menus/*.menu set ft=xml
|
|
au BufNewFile,BufRead *fglrxrc set ft=xml
|
|
au BufNewFile,BufRead {.,}classpath set ft=xml
|
|
au BufNewFile,BufRead {.,}cproject set ft=xml
|
|
au BufNewFile,BufRead {.,}project set ft=xml
|
|
au BufNewFile,BufRead App.config set ft=xml
|
|
au BufNewFile,BufRead NuGet.config set ft=xml
|
|
au BufNewFile,BufRead Settings.StyleCop set ft=xml
|
|
au BufNewFile,BufRead Web.Debug.config set ft=xml
|
|
au BufNewFile,BufRead Web.Release.config set ft=xml
|
|
au BufNewFile,BufRead Web.config set ft=xml
|
|
au BufNewFile,BufRead packages.config set ft=xml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ant')
|
|
au BufNewFile,BufRead build.xml set ft=ant
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'apache')
|
|
au BufNewFile,BufRead */etc/apache2/*.conf* call s:StarSetf('apache')
|
|
au BufNewFile,BufRead */etc/apache2/conf.*/* call s:StarSetf('apache')
|
|
au BufNewFile,BufRead */etc/apache2/mods-*/* call s:StarSetf('apache')
|
|
au BufNewFile,BufRead */etc/apache2/sites-*/* call s:StarSetf('apache')
|
|
au BufNewFile,BufRead */etc/apache2/sites-*/*.com set ft=apache
|
|
au BufNewFile,BufRead */etc/httpd/*.conf set ft=apache
|
|
au BufNewFile,BufRead */etc/httpd/conf.d/*.conf* call s:StarSetf('apache')
|
|
au BufNewFile,BufRead {.,}htaccess set ft=apache
|
|
au BufNewFile,BufRead access.conf* call s:StarSetf('apache')
|
|
au BufNewFile,BufRead apache.conf* call s:StarSetf('apache')
|
|
au BufNewFile,BufRead apache2.conf* call s:StarSetf('apache')
|
|
au BufNewFile,BufRead httpd.conf* call s:StarSetf('apache')
|
|
au BufNewFile,BufRead srm.conf* call s:StarSetf('apache')
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'apiblueprint')
|
|
au BufNewFile,BufRead *.apib set ft=apiblueprint
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'applescript')
|
|
au BufNewFile,BufRead *.applescript,*.scpt set ft=applescript
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'aptconf')
|
|
au BufNewFile,BufRead */.aptitude/config set ft=aptconf
|
|
au BufNewFile,BufRead */etc/apt/apt.conf.d/*.conf set ft=aptconf
|
|
au BufNewFile,BufRead */etc/apt/apt.conf.d/[^.]* call s:StarSetf('aptconf')
|
|
au BufNewFile,BufRead apt.conf set ft=aptconf
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'arch')
|
|
au BufNewFile,BufRead {.,}arch-inventory set ft=arch
|
|
au BufNewFile,BufRead =tagging-method set ft=arch
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'c/c++')
|
|
au BufNewFile,BufRead *.c++,*.cc,*.cp,*.cpp,*.cxx,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.moc,*.tcc,*.tlh,*.tpp set ft=cpp
|
|
au BufNewFile,BufRead *.c,*.cats,*.idc,*.qc set ft=c
|
|
au BufNewFile,BufRead *enlightenment/*.cfg set ft=c
|
|
au! BufNewFile,BufRead *.h call polyglot#DetectHFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'arduino')
|
|
au BufNewFile,BufRead *.ino,*.pde set ft=arduino
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'art')
|
|
au BufNewFile,BufRead *.art set ft=art
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'asciidoc')
|
|
au BufNewFile,BufRead *.adoc,*.asc,*.asciidoc set ft=asciidoc
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'autohotkey')
|
|
au BufNewFile,BufRead *.ahk,*.ahkl set ft=autohotkey
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'elf')
|
|
au BufNewFile,BufRead *.am set ft=elf
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'automake')
|
|
au BufNewFile,BufRead GNUmakefile.am set ft=automake
|
|
au BufNewFile,BufRead [Mm]akefile.am set ft=automake
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'asn')
|
|
au BufNewFile,BufRead *.asn,*.asn1 set ft=asn
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'aspvbs')
|
|
au! BufNewFile,BufRead *.asa call polyglot#DetectAsaFiletype()
|
|
au! BufNewFile,BufRead *.asp call polyglot#DetectAspFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'aspperl')
|
|
au! BufNewFile,BufRead *.asp call polyglot#DetectAspFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'atlas')
|
|
au BufNewFile,BufRead *.as,*.atl set ft=atlas
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'autoit')
|
|
au BufNewFile,BufRead *.au3 set ft=autoit
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ave')
|
|
au BufNewFile,BufRead *.ave set ft=ave
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'awk')
|
|
au BufNewFile,BufRead *.awk,*.gawk set ft=awk
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'caddyfile')
|
|
au BufNewFile,BufRead Caddyfile set ft=caddyfile
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'carp')
|
|
au BufNewFile,BufRead *.carp set ft=carp
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'clojure')
|
|
au BufNewFile,BufRead *.boot,*.cl2,*.clj,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.edn,*.hic set ft=clojure
|
|
au BufNewFile,BufRead build.boot set ft=clojure
|
|
au BufNewFile,BufRead profile.boot set ft=clojure
|
|
au BufNewFile,BufRead riemann.config set ft=clojure
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'cmake')
|
|
au BufNewFile,BufRead *.cmake,*.cmake.in set ft=cmake
|
|
au BufNewFile,BufRead CMakeLists.txt set ft=cmake
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'coffee-script')
|
|
au BufNewFile,BufRead *._coffee,*.cake,*.cjsx,*.coffee,*.coffeekup,*.iced set ft=coffee
|
|
au BufNewFile,BufRead Cakefile set ft=coffee
|
|
au BufNewFile,BufRead *.coffee.md,*.litcoffee set ft=litcoffee
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'cryptol')
|
|
au BufNewFile,BufRead *.cry,*.cyl,*.lcry,*.lcyl set ft=cryptol
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'crystal')
|
|
au BufNewFile,BufRead *.cr set ft=crystal
|
|
au BufNewFile,BufRead Projectfile set ft=crystal
|
|
au BufNewFile,BufRead *.ecr set ft=ecrystal
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'csv')
|
|
au BufNewFile,BufRead *.csv,*.tab,*.tsv set ft=csv
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'cucumber')
|
|
au BufNewFile,BufRead *.feature,*.story set ft=cucumber
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'cue')
|
|
au BufNewFile,BufRead *.cue set ft=cuesheet
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'dart')
|
|
au BufNewFile,BufRead *.dart,*.drt set ft=dart
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'dhall')
|
|
au BufNewFile,BufRead *.dhall set ft=dhall
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'dlang')
|
|
au BufNewFile,BufRead *.d,*.di set ft=d
|
|
au BufNewFile,BufRead *.lst set ft=dcov
|
|
au BufNewFile,BufRead *.dd set ft=dd
|
|
au BufNewFile,BufRead *.ddoc set ft=ddoc
|
|
au BufNewFile,BufRead *.sdl set ft=dsdl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'dockerfile')
|
|
au BufNewFile,BufRead *.Dockerfile,*.dock,*.dockerfile set ft=Dockerfile
|
|
au BufNewFile,BufRead Dockerfile set ft=Dockerfile
|
|
au BufNewFile,BufRead Dockerfile* call s:StarSetf('Dockerfile')
|
|
au BufNewFile,BufRead dockerfile set ft=Dockerfile
|
|
au BufNewFile,BufRead docker-compose*.yaml set ft=yaml.docker-compose
|
|
au BufNewFile,BufRead docker-compose*.yml set ft=yaml.docker-compose
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'elixir')
|
|
au BufNewFile,BufRead *.ex,*.exs set ft=elixir
|
|
au BufNewFile,BufRead mix.lock set ft=elixir
|
|
au BufNewFile,BufRead *.eex,*.leex set ft=eelixir
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'elm')
|
|
au BufNewFile,BufRead *.elm set ft=elm
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'emberscript')
|
|
au BufNewFile,BufRead *.em,*.emberscript set ft=ember-script
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'emblem')
|
|
au BufNewFile,BufRead *.em,*.emblem set ft=emblem
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'erlang')
|
|
au BufNewFile,BufRead *.app,*.app.src,*.erl,*.es,*.escript,*.hrl,*.xrl,*.yaws,*.yrl set ft=erlang
|
|
au BufNewFile,BufRead Emakefile set ft=erlang
|
|
au BufNewFile,BufRead rebar.config set ft=erlang
|
|
au BufNewFile,BufRead rebar.config.lock set ft=erlang
|
|
au BufNewFile,BufRead rebar.lock set ft=erlang
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'fennel')
|
|
au BufNewFile,BufRead *.fnl set ft=fennel
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ferm')
|
|
au BufNewFile,BufRead *.ferm set ft=ferm
|
|
au BufNewFile,BufRead ferm.conf set ft=ferm
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'fish')
|
|
au BufNewFile,BufRead *.fish set ft=fish
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'flatbuffers')
|
|
au BufNewFile,BufRead *.fbs set ft=fbs
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'forth')
|
|
au BufNewFile,BufRead *.ft,*.fth set ft=forth
|
|
au! BufNewFile,BufRead *.fs call polyglot#DetectFsFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'glsl')
|
|
au BufNewFile,BufRead *.comp,*.fp,*.frag,*.frg,*.fsh,*.fshader,*.geo,*.geom,*.glsl,*.glslf,*.glslv,*.gs,*.gshader,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader set ft=glsl
|
|
au! BufNewFile,BufRead *.fs call polyglot#DetectFsFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'fsharp')
|
|
au BufNewFile,BufRead *.fsi,*.fsx set ft=fsharp
|
|
au! BufNewFile,BufRead *.fs call polyglot#DetectFsFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'gdscript')
|
|
au BufNewFile,BufRead *.gd set ft=gdscript3
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'git')
|
|
au BufNewFile,BufRead *.gitconfig set ft=gitconfig
|
|
au BufNewFile,BufRead *.git/config set ft=gitconfig
|
|
au BufNewFile,BufRead *.git/modules/*/config set ft=gitconfig
|
|
au BufNewFile,BufRead */.config/git/config set ft=gitconfig
|
|
au BufNewFile,BufRead */git/config set ft=gitconfig
|
|
au BufNewFile,BufRead */{.,}gitconfig.d/* call s:StarSetf('gitconfig')
|
|
au BufNewFile,BufRead {.,}gitconfig set ft=gitconfig
|
|
au BufNewFile,BufRead {.,}gitmodules set ft=gitconfig
|
|
au BufNewFile,BufRead git-rebase-todo set ft=gitrebase
|
|
au BufNewFile,BufRead {.,}gitsendemail.* call s:StarSetf('gitsendemail')
|
|
au BufNewFile,BufRead COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG set ft=gitcommit
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'gmpl')
|
|
au BufNewFile,BufRead *.mod set ft=gmpl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'gnuplot')
|
|
au BufNewFile,BufRead *.gnu,*.gnuplot,*.gp,*.gpi,*.p,*.plot,*.plt set ft=gnuplot
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'go')
|
|
au BufNewFile,BufRead *.go set ft=go
|
|
au BufNewFile,BufRead go.mod set ft=gomod
|
|
au BufNewFile,BufRead *.tmpl set ft=gohtmltmpl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'javascript')
|
|
au BufNewFile,BufRead *._js,*.bones,*.cjs,*.es,*.es6,*.frag,*.gs,*.jake,*.javascript,*.js,*.jsb,*.jscad,*.jsfl,*.jsm,*.jss,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib set ft=javascript
|
|
au BufNewFile,BufRead Jakefile set ft=javascript
|
|
au BufNewFile,BufRead *.flow set ft=flow
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'jsx')
|
|
au BufNewFile,BufRead *.jsx set ft=javascriptreact
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'graphql')
|
|
au BufNewFile,BufRead *.gql,*.graphql,*.graphqls set ft=graphql
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'groovy')
|
|
au BufNewFile,BufRead *.gradle,*.groovy,*.grt,*.gtpl,*.gvy set ft=groovy
|
|
au BufNewFile,BufRead Jenkinsfile set ft=groovy
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'grub')
|
|
au BufNewFile,BufRead */boot/grub/grub.conf set ft=grub
|
|
au BufNewFile,BufRead */boot/grub/menu.lst set ft=grub
|
|
au BufNewFile,BufRead */etc/grub.conf set ft=grub
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'haml')
|
|
au BufNewFile,BufRead *.haml,*.haml.deface,*.hamlbars,*.hamlc set ft=haml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'handlebars')
|
|
au BufNewFile,BufRead *.hjs,*.hogan,*.hulk,*.mustache set ft=html.mustache
|
|
au BufNewFile,BufRead *.handlebars,*.hb,*.hbs,*.hdbs set ft=html.handlebars
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'haskell')
|
|
au BufNewFile,BufRead *.bpk,*.hs,*.hs-boot,*.hsc,*.hsig set ft=haskell
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'haxe')
|
|
au BufNewFile,BufRead *.hx,*.hxsl set ft=haxe
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'hcl')
|
|
au BufNewFile,BufRead *.hcl,*.nomad,*.workflow set ft=hcl
|
|
au BufNewFile,BufRead Appfile set ft=hcl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'hive')
|
|
au BufNewFile,BufRead *.hql,*.q,*.ql set ft=hive
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'html5')
|
|
au BufNewFile,BufRead *.htm,*.html.hl,*.inc,*.st,*.xht,*.xhtml set ft=html
|
|
au! BufNewFile,BufRead *.html call polyglot#DetectHtmlFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'i3')
|
|
au BufNewFile,BufRead *.i3.config,*.i3config set ft=i3config
|
|
au BufNewFile,BufRead {.,}i3.config set ft=i3config
|
|
au BufNewFile,BufRead {.,}i3config set ft=i3config
|
|
au BufNewFile,BufRead i3.config set ft=i3config
|
|
au BufNewFile,BufRead i3config set ft=i3config
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'icalendar')
|
|
au BufNewFile,BufRead *.ics set ft=icalendar
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'idris')
|
|
au BufNewFile,BufRead idris-response set ft=idris
|
|
au! BufNewFile,BufRead *.idr call polyglot#DetectIdrFiletype()
|
|
au! BufNewFile,BufRead *.lidr call polyglot#DetectLidrFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'idris2')
|
|
au BufNewFile,BufRead *.ipkg set ft=idris2
|
|
au BufNewFile,BufRead idris-response set ft=idris2
|
|
au! BufNewFile,BufRead *.idr call polyglot#DetectIdrFiletype()
|
|
au! BufNewFile,BufRead *.lidr call polyglot#DetectLidrFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ion')
|
|
au BufNewFile,BufRead *.ion set ft=ion
|
|
au BufNewFile,BufRead ~/.config/ion/initrc set ft=ion
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'jenkins')
|
|
au BufNewFile,BufRead *.Jenkinsfile,*.jenkinsfile set ft=Jenkinsfile
|
|
au BufNewFile,BufRead Jenkinsfile set ft=Jenkinsfile
|
|
au BufNewFile,BufRead Jenkinsfile* call s:StarSetf('Jenkinsfile')
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'htmldjango')
|
|
au BufNewFile,BufRead *.j2,*.jinja,*.jinja2,*.njk set ft=htmldjango
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'jq')
|
|
au BufNewFile,BufRead *.jq set ft=jq
|
|
au BufNewFile,BufRead {.,}jqrc set ft=jq
|
|
au BufNewFile,BufRead {.,}jqrc* call s:StarSetf('jq')
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'json5')
|
|
au BufNewFile,BufRead *.json5 set ft=json5
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'json')
|
|
au BufNewFile,BufRead *.JSON-tmLanguage,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.json,*.jsonl,*.jsonp,*.mcmeta,*.template,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp set ft=json
|
|
au BufNewFile,BufRead {.,}arcconfig set ft=json
|
|
au BufNewFile,BufRead {.,}htmlhintrc set ft=json
|
|
au BufNewFile,BufRead {.,}tern-config set ft=json
|
|
au BufNewFile,BufRead {.,}tern-project set ft=json
|
|
au BufNewFile,BufRead {.,}watchmanconfig set ft=json
|
|
au BufNewFile,BufRead Pipfile.lock set ft=json
|
|
au BufNewFile,BufRead composer.lock set ft=json
|
|
au BufNewFile,BufRead mcmod.info set ft=json
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'jsonnet')
|
|
au BufNewFile,BufRead *.jsonnet,*.libsonnet set ft=jsonnet
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'jst')
|
|
au BufNewFile,BufRead *.ect,*.ejs,*.jst set ft=jst
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'julia')
|
|
au BufNewFile,BufRead *.jl set ft=julia
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'kotlin')
|
|
au BufNewFile,BufRead *.kt,*.ktm,*.kts set ft=kotlin
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ledger')
|
|
au BufNewFile,BufRead *.journal,*.ldg,*.ledger set ft=ledger
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'less')
|
|
au BufNewFile,BufRead *.less set ft=less
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'lilypond')
|
|
au BufNewFile,BufRead *.ily,*.ly set ft=lilypond
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'livescript')
|
|
au BufNewFile,BufRead *._ls,*.ls set ft=livescript
|
|
au BufNewFile,BufRead Slakefile set ft=livescript
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'llvm')
|
|
au BufNewFile,BufRead *.ll set ft=llvm
|
|
au BufNewFile,BufRead *.td set ft=tablegen
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'log')
|
|
au BufNewFile,BufRead *.LOG,*.log set ft=log
|
|
au BufNewFile,BufRead *_LOG set ft=log
|
|
au BufNewFile,BufRead *_log set ft=log
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'lua')
|
|
au BufNewFile,BufRead *.fcgi,*.lua,*.nse,*.p8,*.pd_lua,*.rbxs,*.rockspec,*.wlua set ft=lua
|
|
au BufNewFile,BufRead {.,}luacheckrc set ft=lua
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'm4')
|
|
au BufNewFile,BufRead *.at,*.m4 set ft=m4
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'mako')
|
|
au BufNewFile *.*.mako execute "do BufNewFile filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype
|
|
au BufReadPre *.*.mako execute "do BufRead filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype
|
|
au BufNewFile *.*.mao execute "do BufNewFile filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype
|
|
au BufReadPre *.*.mao execute "do BufRead filetypedetect " . expand("<afile>:r") | let b:mako_outer_lang = &filetype
|
|
au BufNewFile,BufRead *.mako,*.mao set ft=mako
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'mathematica')
|
|
au BufNewFile,BufRead *.cdf,*.ma,*.mathematica,*.mma,*.mt,*.nb,*.nbp,*.wl,*.wls,*.wlt set ft=mma
|
|
au! BufNewFile,BufRead *.m call polyglot#DetectMFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'markdown')
|
|
au BufNewFile,BufRead *.markdown,*.md,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.workbook set ft=markdown
|
|
au BufNewFile,BufRead contents.lr set ft=markdown
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'mdx')
|
|
au BufNewFile,BufRead *.mdx set ft=markdown.mdx
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'meson')
|
|
au BufNewFile,BufRead meson.build set ft=meson
|
|
au BufNewFile,BufRead meson_options.txt set ft=meson
|
|
au BufNewFile,BufRead *.wrap set ft=dosini
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'moonscript')
|
|
au BufNewFile,BufRead *.moon set ft=moon
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'murphi')
|
|
au! BufNewFile,BufRead *.m call polyglot#DetectMFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'nginx')
|
|
au BufNewFile,BufRead *.nginx,*.nginxconf,*.vhost set ft=nginx
|
|
au BufNewFile,BufRead */etc/nginx/* call s:StarSetf('nginx')
|
|
au BufNewFile,BufRead */nginx/*.conf set ft=nginx
|
|
au BufNewFile,BufRead */usr/local/nginx/conf/* call s:StarSetf('nginx')
|
|
au BufNewFile,BufRead *nginx.conf set ft=nginx
|
|
au BufNewFile,BufRead nginx*.conf set ft=nginx
|
|
au BufNewFile,BufRead nginx.conf set ft=nginx
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'nim')
|
|
au BufNewFile,BufRead *.nim,*.nim.cfg,*.nimble,*.nimrod,*.nims set ft=nim
|
|
au BufNewFile,BufRead nim.cfg set ft=nim
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'nix')
|
|
au BufNewFile,BufRead *.nix set ft=nix
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'objc')
|
|
au! BufNewFile,BufRead *.h call polyglot#DetectHFiletype()
|
|
au! BufNewFile,BufRead *.m call polyglot#DetectMFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ocaml')
|
|
au BufNewFile,BufRead *.eliom,*.eliomi,*.ml,*.ml.cppo,*.ml4,*.mli,*.mli.cppo,*.mlip,*.mll,*.mlp,*.mlt,*.mly set ft=ocaml
|
|
au BufNewFile,BufRead {.,}ocamlinit set ft=ocaml
|
|
au BufNewFile,BufRead *.om set ft=omake
|
|
au BufNewFile,BufRead OMakefile set ft=omake
|
|
au BufNewFile,BufRead OMakeroot set ft=omake
|
|
au BufNewFile,BufRead OMakeroot.in set ft=omake
|
|
au BufNewFile,BufRead *.opam,*.opam.template set ft=opam
|
|
au BufNewFile,BufRead opam set ft=opam
|
|
au BufNewFile,BufRead _oasis set ft=oasis
|
|
au BufNewFile,BufRead dune set ft=dune
|
|
au BufNewFile,BufRead dune-project set ft=dune
|
|
au BufNewFile,BufRead dune-workspace set ft=dune
|
|
au BufNewFile,BufRead jbuild set ft=dune
|
|
au BufNewFile,BufRead _tags set ft=ocamlbuild_tags
|
|
au BufNewFile,BufRead *.ocp set ft=ocpbuild
|
|
au BufNewFile,BufRead *.root set ft=ocpbuildroot
|
|
au BufNewFile,BufRead *.sexp set ft=sexplib
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'octave')
|
|
au BufNewFile,BufRead *.oct set ft=octave
|
|
au! BufNewFile,BufRead *.m call polyglot#DetectMFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'opencl')
|
|
au BufNewFile,BufRead *.cl,*.opencl set ft=opencl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'perl')
|
|
au BufNewFile,BufRead *.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.psgi set ft=perl
|
|
au BufNewFile,BufRead {.,}gitolite.rc set ft=perl
|
|
au BufNewFile,BufRead Makefile.PL set ft=perl
|
|
au BufNewFile,BufRead Rexfile set ft=perl
|
|
au BufNewFile,BufRead ack set ft=perl
|
|
au BufNewFile,BufRead cpanfile set ft=perl
|
|
au BufNewFile,BufRead example.gitolite.rc set ft=perl
|
|
au BufNewFile,BufRead *.pod set ft=pod
|
|
au BufNewFile,BufRead *.comp,*.mason,*.mhtml set ft=mason
|
|
au BufNewFile,BufRead *.xs set ft=xs
|
|
au! BufNewFile,BufRead *.pl call polyglot#DetectPlFiletype()
|
|
au! BufNewFile,BufRead *.pm call polyglot#DetectPmFiletype()
|
|
au! BufNewFile,BufRead *.t call polyglot#DetectTFiletype()
|
|
au! BufNewFile,BufRead *.tt2 call polyglot#DetectTt2Filetype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'pgsql')
|
|
au BufNewFile,BufRead *.pgsql let b:sql_type_override='pgsql' | set ft=sql
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'cql')
|
|
au BufNewFile,BufRead *.cql set ft=cql
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'php')
|
|
au BufNewFile,BufRead *.aw,*.ctp,*.fcgi,*.inc,*.php,*.php3,*.php4,*.php5,*.phps,*.phpt,*.phtml set ft=php
|
|
au BufNewFile,BufRead {.,}php set ft=php
|
|
au BufNewFile,BufRead {.,}php_cs set ft=php
|
|
au BufNewFile,BufRead {.,}php_cs.dist set ft=php
|
|
au BufNewFile,BufRead Phakefile set ft=php
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'blade')
|
|
au BufNewFile,BufRead *.blade,*.blade.php set ft=blade
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'plantuml')
|
|
au BufNewFile,BufRead *.iuml,*.plantuml,*.pu,*.puml,*.uml set ft=plantuml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'pony')
|
|
au BufNewFile,BufRead *.pony set ft=pony
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'powershell')
|
|
au BufNewFile,BufRead *.ps1,*.psd1,*.psm1,*.pssc set ft=ps1
|
|
au BufNewFile,BufRead *.ps1xml set ft=ps1xml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'protobuf')
|
|
au BufNewFile,BufRead *.proto set ft=proto
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'pug')
|
|
au BufNewFile,BufRead *.jade,*.pug set ft=pug
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'puppet')
|
|
au BufNewFile,BufRead *.pp set ft=puppet
|
|
au BufNewFile,BufRead Modulefile set ft=puppet
|
|
au BufNewFile,BufRead *.epp set ft=embeddedpuppet
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'purescript')
|
|
au BufNewFile,BufRead *.purs set ft=purescript
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'python')
|
|
au BufNewFile,BufRead *.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.ptl,*.py,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.smk,*.spec,*.tac,*.wsgi,*.xpy set ft=python
|
|
au BufNewFile,BufRead {.,}gclient set ft=python
|
|
au BufNewFile,BufRead {.,}pythonrc set ft=python
|
|
au BufNewFile,BufRead {.,}pythonstartup set ft=python
|
|
au BufNewFile,BufRead DEPS set ft=python
|
|
au BufNewFile,BufRead SConscript set ft=python
|
|
au BufNewFile,BufRead SConstruct set ft=python
|
|
au BufNewFile,BufRead Snakefile set ft=python
|
|
au BufNewFile,BufRead wscript set ft=python
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'requirements')
|
|
au BufNewFile,BufRead *.pip set ft=requirements
|
|
au BufNewFile,BufRead *require.{txt,in} set ft=requirements
|
|
au BufNewFile,BufRead *requirements.{txt,in} set ft=requirements
|
|
au BufNewFile,BufRead constraints.{txt,in} set ft=requirements
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'qmake')
|
|
au BufNewFile,BufRead *.pri,*.pro set ft=qmake
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'qml')
|
|
au BufNewFile,BufRead *.qbs,*.qml set ft=qml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'r-lang')
|
|
au BufNewFile,BufRead *.S,*.r,*.rsx,*.s set ft=r
|
|
au BufNewFile,BufRead {.,}Rprofile set ft=r
|
|
au BufNewFile,BufRead expr-dist set ft=r
|
|
au BufNewFile,BufRead *.rd set ft=rhelp
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'racket')
|
|
au BufNewFile,BufRead *.rkt,*.rktd,*.rktl,*.scrbl set ft=racket
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ragel')
|
|
au BufNewFile,BufRead *.rl set ft=ragel
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'raku')
|
|
au BufNewFile,BufRead *.6pl,*.6pm,*.nqp,*.p6,*.p6l,*.p6m,*.pl6,*.pm6,*.pod6,*.raku,*.rakudoc,*.rakumod,*.rakutest,*.t6 set ft=raku
|
|
au! BufNewFile,BufRead *.pl call polyglot#DetectPlFiletype()
|
|
au! BufNewFile,BufRead *.pm call polyglot#DetectPmFiletype()
|
|
au! BufNewFile,BufRead *.t call polyglot#DetectTFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'raml')
|
|
au BufNewFile,BufRead *.raml set ft=raml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'razor')
|
|
au BufNewFile,BufRead *.cshtml,*.razor set ft=razor
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'reason')
|
|
au BufNewFile,BufRead *.rei set ft=reason
|
|
au! BufNewFile,BufRead *.re call polyglot#DetectReFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'rst')
|
|
au BufNewFile,BufRead *.rest,*.rest.txt,*.rst,*.rst.txt set ft=rst
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ruby')
|
|
au BufNewFile,BufRead *.axlsx,*.builder,*.cap,*.eye,*.fcgi,*.gemspec,*.god,*.jbuilder,*.mspec,*.opal,*.pluginspec,*.podspec,*.rabl,*.rake,*.rant,*.rb,*.rbi,*.rbuild,*.rbw,*.rbx,*.rjs,*.ru,*.ruby,*.rxml,*.spec,*.thor,*.watchr set ft=ruby
|
|
au BufNewFile,BufRead {.,}Brewfile set ft=ruby
|
|
au BufNewFile,BufRead {.,}Guardfile set ft=ruby
|
|
au BufNewFile,BufRead {.,}autotest set ft=ruby
|
|
au BufNewFile,BufRead {.,}irbrc set ft=ruby
|
|
au BufNewFile,BufRead {.,}pryrc set ft=ruby
|
|
au BufNewFile,BufRead {.,}simplecov set ft=ruby
|
|
au BufNewFile,BufRead Appraisals set ft=ruby
|
|
au BufNewFile,BufRead Berksfile set ft=ruby
|
|
au BufNewFile,BufRead Buildfile set ft=ruby
|
|
au BufNewFile,BufRead Capfile set ft=ruby
|
|
au BufNewFile,BufRead Cheffile set ft=ruby
|
|
au BufNewFile,BufRead Dangerfile set ft=ruby
|
|
au BufNewFile,BufRead Deliverfile set ft=ruby
|
|
au BufNewFile,BufRead Fastfile set ft=ruby
|
|
au BufNewFile,BufRead Gemfile set ft=ruby
|
|
au BufNewFile,BufRead Gemfile.lock set ft=ruby
|
|
au BufNewFile,BufRead Guardfile set ft=ruby
|
|
au BufNewFile,BufRead Jarfile set ft=ruby
|
|
au BufNewFile,BufRead KitchenSink set ft=ruby
|
|
au BufNewFile,BufRead Mavenfile set ft=ruby
|
|
au BufNewFile,BufRead Podfile set ft=ruby
|
|
au BufNewFile,BufRead Puppetfile set ft=ruby
|
|
au BufNewFile,BufRead Rakefile set ft=ruby
|
|
au BufNewFile,BufRead Rantfile set ft=ruby
|
|
au BufNewFile,BufRead Routefile set ft=ruby
|
|
au BufNewFile,BufRead Snapfile set ft=ruby
|
|
au BufNewFile,BufRead Thorfile set ft=ruby
|
|
au BufNewFile,BufRead Vagrantfile set ft=ruby
|
|
au BufNewFile,BufRead [Rr]akefile* call s:StarSetf('ruby')
|
|
au BufNewFile,BufRead buildfile set ft=ruby
|
|
au BufNewFile,BufRead vagrantfile set ft=ruby
|
|
au BufNewFile,BufRead *.erb,*.erb.deface,*.rhtml set ft=eruby
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'rspec')
|
|
au BufNewFile,BufRead *_spec.rb set ft=ruby syntax=rspec
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'brewfile')
|
|
au BufNewFile,BufRead Brewfile set ft=brewfile
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'rust')
|
|
au BufNewFile,BufRead *.rs,*.rs.in set ft=rust
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'scala')
|
|
au BufNewFile,BufRead *.kojo,*.sc,*.scala set ft=scala
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'sbt')
|
|
au BufNewFile,BufRead *.sbt set ft=sbt.scala
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'scss')
|
|
au BufNewFile,BufRead *.scss set ft=scss
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'sh')
|
|
au BufNewFile,BufRead *.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh,*.sh.in,*.tmux,*.tool set ft=sh
|
|
au BufNewFile,BufRead */etc/udev/cdsymlinks.conf set ft=sh
|
|
au BufNewFile,BufRead {.,}bash_aliases set ft=sh
|
|
au BufNewFile,BufRead {.,}bash_history set ft=sh
|
|
au BufNewFile,BufRead {.,}bash_logout set ft=sh
|
|
au BufNewFile,BufRead {.,}bash_profile set ft=sh
|
|
au BufNewFile,BufRead {.,}bashrc set ft=sh
|
|
au BufNewFile,BufRead {.,}cshrc set ft=sh
|
|
au BufNewFile,BufRead {.,}env set ft=sh
|
|
au BufNewFile,BufRead {.,}env.example set ft=sh
|
|
au BufNewFile,BufRead {.,}flaskenv set ft=sh
|
|
au BufNewFile,BufRead {.,}login set ft=sh
|
|
au BufNewFile,BufRead {.,}profile set ft=sh
|
|
au BufNewFile,BufRead 9fs set ft=sh
|
|
au BufNewFile,BufRead PKGBUILD set ft=sh
|
|
au BufNewFile,BufRead bash_aliases set ft=sh
|
|
au BufNewFile,BufRead bash_logout set ft=sh
|
|
au BufNewFile,BufRead bash_profile set ft=sh
|
|
au BufNewFile,BufRead bashrc set ft=sh
|
|
au BufNewFile,BufRead cshrc set ft=sh
|
|
au BufNewFile,BufRead gradlew set ft=sh
|
|
au BufNewFile,BufRead login set ft=sh
|
|
au BufNewFile,BufRead man set ft=sh
|
|
au BufNewFile,BufRead profile set ft=sh
|
|
au BufNewFile,BufRead zlogin set ft=sh
|
|
au BufNewFile,BufRead zlogout set ft=sh
|
|
au BufNewFile,BufRead zprofile set ft=sh
|
|
au BufNewFile,BufRead zshenv set ft=sh
|
|
au BufNewFile,BufRead zshrc set ft=sh
|
|
au BufNewFile,BufRead *.zsh set ft=zsh
|
|
au BufNewFile,BufRead {.,}zcompdump* call s:StarSetf('zsh')
|
|
au BufNewFile,BufRead {.,}zfbfmarks set ft=zsh
|
|
au BufNewFile,BufRead {.,}zlog* call s:StarSetf('zsh')
|
|
au BufNewFile,BufRead {.,}zlogin set ft=zsh
|
|
au BufNewFile,BufRead {.,}zlogout set ft=zsh
|
|
au BufNewFile,BufRead {.,}zprofile set ft=zsh
|
|
au BufNewFile,BufRead {.,}zsh* call s:StarSetf('zsh')
|
|
au BufNewFile,BufRead {.,}zshenv set ft=zsh
|
|
au BufNewFile,BufRead {.,}zshrc set ft=zsh
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'slim')
|
|
au BufNewFile,BufRead *.slim set ft=slim
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'slime')
|
|
au BufNewFile,BufRead *.slime set ft=slime
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'smt2')
|
|
au BufNewFile,BufRead *.smt,*.smt2 set ft=smt2
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'solidity')
|
|
au BufNewFile,BufRead *.sol set ft=solidity
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'stylus')
|
|
au BufNewFile,BufRead *.styl,*.stylus set ft=stylus
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'svelte')
|
|
au BufNewFile,BufRead *.svelte set ft=svelte
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'svg')
|
|
au BufNewFile,BufRead *.svg set ft=svg
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'swift')
|
|
au BufNewFile,BufRead *.swift set ft=swift
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'sxhkd')
|
|
au BufNewFile,BufRead *.sxhkdrc set ft=sxhkdrc
|
|
au BufNewFile,BufRead sxhkdrc set ft=sxhkdrc
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'systemd')
|
|
au BufNewFile,BufRead *.automount,*.dnssd,*.link,*.mount,*.netdev,*.network,*.nspawn,*.path,*.service,*.slice,*.socket,*.swap,*.target,*.timer set ft=systemd
|
|
au BufNewFile,BufRead *.#* call s:StarSetf('systemd')
|
|
au BufNewFile,BufRead */systemd/*.conf set ft=systemd
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'terraform')
|
|
au BufNewFile,BufRead *.hcl,*.nomad,*.tf,*.tfvars,*.workflow set ft=terraform
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'textile')
|
|
au BufNewFile,BufRead *.textile set ft=textile
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'thrift')
|
|
au BufNewFile,BufRead *.thrift set ft=thrift
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'tmux')
|
|
au BufNewFile,BufRead {.,}tmux*.conf set ft=tmux
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'toml')
|
|
au BufNewFile,BufRead *.toml set ft=toml
|
|
au BufNewFile,BufRead */.cargo/config set ft=toml
|
|
au BufNewFile,BufRead */.cargo/credentials set ft=toml
|
|
au BufNewFile,BufRead Cargo.lock set ft=toml
|
|
au BufNewFile,BufRead Gopkg.lock set ft=toml
|
|
au BufNewFile,BufRead Pipfile set ft=toml
|
|
au BufNewFile,BufRead poetry.lock set ft=toml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'tptp')
|
|
au BufNewFile,BufRead *.ax,*.p,*.tptp set ft=tptp
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'twig')
|
|
au BufNewFile,BufRead *.twig set ft=html.twig
|
|
au BufNewFile,BufRead *.xml.twig set ft=xml.twig
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'typescript')
|
|
au BufNewFile,BufRead *.ts set ft=typescript
|
|
au BufNewFile,BufRead *.tsx set ft=typescriptreact
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'unison')
|
|
au BufNewFile,BufRead *.u,*.uu set ft=unison
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'v')
|
|
au BufNewFile,BufRead *.v set ft=v
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'vala')
|
|
au BufNewFile,BufRead *.vala,*.valadoc,*.vapi set ft=vala
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'vbnet')
|
|
au BufNewFile,BufRead *.vb,*.vbhtml set ft=vbnet
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'vcl')
|
|
au BufNewFile,BufRead *.vcl set ft=vcl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'velocity')
|
|
au BufNewFile,BufRead *.vm set ft=velocity
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'vmasm')
|
|
au BufNewFile,BufRead *.mar set ft=vmasm
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'vue')
|
|
au BufNewFile,BufRead *.vue,*.wpy set ft=vue
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'xdc')
|
|
au BufNewFile,BufRead *.xdc set ft=xdc
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'xsl')
|
|
au BufNewFile,BufRead *.xsl,*.xslt set ft=xsl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'yaml')
|
|
au BufNewFile,BufRead *.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml,*.yml.mysql set ft=yaml
|
|
au BufNewFile,BufRead {.,}clang-format set ft=yaml
|
|
au BufNewFile,BufRead {.,}clang-tidy set ft=yaml
|
|
au BufNewFile,BufRead {.,}gemrc set ft=yaml
|
|
au BufNewFile,BufRead fish_history set ft=yaml
|
|
au BufNewFile,BufRead fish_read_history set ft=yaml
|
|
au BufNewFile,BufRead glide.lock set ft=yaml
|
|
au BufNewFile,BufRead yarn.lock set ft=yaml
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'ansible')
|
|
au BufNewFile,BufRead group_vars/* call s:StarSetf('yaml.ansible')
|
|
au BufNewFile,BufRead handlers.*.y{a,}ml set ft=yaml.ansible
|
|
au BufNewFile,BufRead host_vars/* call s:StarSetf('yaml.ansible')
|
|
au BufNewFile,BufRead local.y{a,}ml set ft=yaml.ansible
|
|
au BufNewFile,BufRead main.y{a,}ml set ft=yaml.ansible
|
|
au BufNewFile,BufRead playbook.y{a,}ml set ft=yaml.ansible
|
|
au BufNewFile,BufRead requirements.y{a,}ml set ft=yaml.ansible
|
|
au BufNewFile,BufRead roles.*.y{a,}ml set ft=yaml.ansible
|
|
au BufNewFile,BufRead site.y{a,}ml set ft=yaml.ansible
|
|
au BufNewFile,BufRead tasks.*.y{a,}ml set ft=yaml.ansible
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'helm')
|
|
au BufNewFile,BufRead */templates/*.tpl set ft=helm
|
|
au BufNewFile,BufRead */templates/*.yaml set ft=helm
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'help')
|
|
au BufNewFile,BufRead $VIMRUNTIME/doc/*.txt set ft=help
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'zephir')
|
|
au BufNewFile,BufRead *.zep set ft=zephir
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'zig')
|
|
au BufNewFile,BufRead *.zir set ft=zir
|
|
au BufNewFile,BufRead *.zig,*.zir set ft=zig
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'trasys')
|
|
au! BufNewFile,BufRead *.inp call polyglot#DetectInpFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'basic')
|
|
au BufNewFile,BufRead *.basic set ft=basic
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'visual-basic')
|
|
au BufNewFile,BufRead *.cls,*.ctl,*.dsm,*.frm,*.frx,*.sba,*.vba,*.vbs set ft=vb
|
|
au! BufNewFile,BufRead *.bas call polyglot#DetectBasFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'dosini')
|
|
au BufNewFile,BufRead *.dof,*.ini,*.lektorproject,*.prefs,*.pro,*.properties set ft=dosini
|
|
au BufNewFile,BufRead */etc/pacman.conf set ft=dosini
|
|
au BufNewFile,BufRead */etc/yum.conf set ft=dosini
|
|
au BufNewFile,BufRead */etc/yum.repos.d/* call s:StarSetf('dosini')
|
|
au BufNewFile,BufRead {.,}editorconfig set ft=dosini
|
|
au BufNewFile,BufRead {.,}npmrc set ft=dosini
|
|
au BufNewFile,BufRead buildozer.spec set ft=dosini
|
|
au BufNewFile,BufRead php.ini-* call s:StarSetf('dosini')
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'odin')
|
|
au BufNewFile,BufRead *.odin set ft=odin
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'bzl')
|
|
au BufNewFile,BufRead *.BUILD,*.bazel,*.bzl set ft=bzl
|
|
au BufNewFile,BufRead BUCK set ft=bzl
|
|
au BufNewFile,BufRead BUILD set ft=bzl
|
|
au BufNewFile,BufRead BUILD.bazel set ft=bzl
|
|
au BufNewFile,BufRead Tiltfile set ft=bzl
|
|
au BufNewFile,BufRead WORKSPACE set ft=bzl
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'prolog')
|
|
au BufNewFile,BufRead *.pdb,*.pro,*.prolog,*.yap set ft=prolog
|
|
au! BufNewFile,BufRead *.pl call polyglot#DetectPlFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'tads')
|
|
au! BufNewFile,BufRead *.t call polyglot#DetectTFiletype()
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'gitignore')
|
|
au BufNewFile,BufRead *.git/info/exclude set ft=gitignore
|
|
au BufNewFile,BufRead */.config/git/ignore set ft=gitignore
|
|
au BufNewFile,BufRead {.,}gitignore set ft=gitignore
|
|
endif
|
|
|
|
if !has_key(s:disabled_packages, 'sql')
|
|
au BufNewFile,BufRead *.bdy,*.ddl,*.fnc,*.pck,*.pkb,*.pks,*.plb,*.pls,*.plsql,*.prc,*.spc,*.sql,*.tpb,*.tps,*.trg,*.tyb,*.tyc,*.typ,*.vw set ft=sql
|
|
endif
|
|
|
|
|
|
|
|
au! BufNewFile,BufRead,StdinReadPost * if expand("<afile>") !~ g:ft_ignore_pat |
|
|
\ call polyglot#Shebang() | endif
|
|
|
|
au BufEnter * if &ft == "" && expand("<afile>") !~ g:ft_ignore_pat |
|
|
\ call s:Observe('Shebang') | endif
|
|
|
|
augroup END
|
|
|
|
if !has_key(s:disabled_packages, 'autoindent')
|
|
" Code below re-implements sleuth for vim-polyglot
|
|
let g:loaded_sleuth = 1
|
|
let g:loaded_foobar = 1
|
|
|
|
" Makes shiftwidth to be synchronized with tabstop by default
|
|
if &shiftwidth == &tabstop
|
|
let &shiftwidth = 0
|
|
endif
|
|
|
|
function! s:guess(lines) abort
|
|
let options = {}
|
|
let ccomment = 0
|
|
let podcomment = 0
|
|
let triplequote = 0
|
|
let backtick = 0
|
|
let xmlcomment = 0
|
|
let heredoc = ''
|
|
let minindent = 10
|
|
let spaces_minus_tabs = 0
|
|
let i = 0
|
|
|
|
for line in a:lines
|
|
let i += 1
|
|
|
|
if !len(line) || line =~# '^\W*$'
|
|
continue
|
|
endif
|
|
|
|
if line =~# '^\s*/\*'
|
|
let ccomment = 1
|
|
endif
|
|
if ccomment
|
|
if line =~# '\*/'
|
|
let ccomment = 0
|
|
endif
|
|
continue
|
|
endif
|
|
|
|
if line =~# '^=\w'
|
|
let podcomment = 1
|
|
endif
|
|
if podcomment
|
|
if line =~# '^=\%(end\|cut\)\>'
|
|
let podcomment = 0
|
|
endif
|
|
continue
|
|
endif
|
|
|
|
if triplequote
|
|
if line =~# '^[^"]*"""[^"]*$'
|
|
let triplequote = 0
|
|
endif
|
|
continue
|
|
elseif line =~# '^[^"]*"""[^"]*$'
|
|
let triplequote = 1
|
|
endif
|
|
|
|
if backtick
|
|
if line =~# '^[^`]*`[^`]*$'
|
|
let backtick = 0
|
|
endif
|
|
continue
|
|
elseif &filetype ==# 'go' && line =~# '^[^`]*`[^`]*$'
|
|
let backtick = 1
|
|
endif
|
|
|
|
if line =~# '^\s*<\!--'
|
|
let xmlcomment = 1
|
|
endif
|
|
if xmlcomment
|
|
if line =~# '-->'
|
|
let xmlcomment = 0
|
|
endif
|
|
continue
|
|
endif
|
|
|
|
" This is correct order because both "<<EOF" and "EOF" matches end
|
|
if heredoc != ''
|
|
if line =~# heredoc
|
|
let heredoc = ''
|
|
endif
|
|
continue
|
|
endif
|
|
let herematch = matchlist(line, '\C<<\W*\([A-Z]\+\)\s*$')
|
|
if len(herematch) > 0
|
|
let heredoc = herematch[1] . '$'
|
|
endif
|
|
|
|
let spaces_minus_tabs += line[0] == "\t" ? 1 : -1
|
|
|
|
if line[0] == "\t"
|
|
setlocal noexpandtab
|
|
let &l:shiftwidth=&tabstop
|
|
let b:sleuth_culprit .= ':' . i
|
|
return 1
|
|
elseif line[0] == " "
|
|
let indent = len(matchstr(line, '^ *'))
|
|
if (indent % 2 == 0 || indent % 3 == 0) && indent < minindent
|
|
let minindent = indent
|
|
endif
|
|
endif
|
|
endfor
|
|
|
|
if minindent < 10
|
|
setlocal expandtab
|
|
let &l:shiftwidth=minindent
|
|
let b:sleuth_culprit .= ':' . i
|
|
return 1
|
|
endif
|
|
|
|
return 0
|
|
endfunction
|
|
|
|
function! s:detect_indent() abort
|
|
if &buftype ==# 'help'
|
|
return
|
|
endif
|
|
|
|
let b:sleuth_culprit = expand("<afile>:p")
|
|
if s:guess(getline(1, 32))
|
|
return
|
|
endif
|
|
let pattern = sleuth#GlobForFiletype(&filetype)
|
|
if len(pattern) == 0
|
|
return
|
|
endif
|
|
let pattern = '{' . pattern . ',.git,.svn,.hg}'
|
|
let dir = expand('%:p:h')
|
|
let level = 3
|
|
while isdirectory(dir) && dir !=# fnamemodify(dir, ':h') && level > 0
|
|
" Ignore files from homedir and root
|
|
if dir == expand('~') || dir == '/'
|
|
unlet b:sleuth_culprit
|
|
return
|
|
endif
|
|
for neighbor in glob(dir . '/' . pattern, 0, 1)[0:level]
|
|
let b:sleuth_culprit = neighbor
|
|
" Do not consider directories above .git, .svn or .hg
|
|
if fnamemodify(neighbor, ":h:t")[0] == "."
|
|
let level = 0
|
|
continue
|
|
endif
|
|
if neighbor !=# expand('%:p') && filereadable(neighbor)
|
|
if s:guess(readfile(neighbor, '', 32))
|
|
return
|
|
endif
|
|
endif
|
|
endfor
|
|
|
|
let dir = fnamemodify(dir, ':h')
|
|
let level -= 1
|
|
endwhile
|
|
|
|
unlet b:sleuth_culprit
|
|
endfunction
|
|
|
|
setglobal smarttab
|
|
|
|
function! SleuthIndicator() abort
|
|
let sw = &shiftwidth ? &shiftwidth : &tabstop
|
|
if &expandtab
|
|
return 'sw='.sw
|
|
elseif &tabstop == sw
|
|
return 'ts='.&tabstop
|
|
else
|
|
return 'sw='.sw.',ts='.&tabstop
|
|
endif
|
|
endfunction
|
|
|
|
augroup polyglot-sleuth
|
|
au!
|
|
au FileType * call s:detect_indent()
|
|
au User Flags call Hoist('buffer', 5, 'SleuthIndicator')
|
|
augroup END
|
|
|
|
command! -bar -bang Sleuth call s:detect_indent()
|
|
endif
|
|
|
|
func! s:verify()
|
|
if exists("g:polyglot_disabled_not_set")
|
|
if exists("g:polyglot_disabled")
|
|
echohl WarningMsg
|
|
echo "vim-polyglot: g:polyglot_disabled should be defined before loading vim-polyglot"
|
|
echohl None
|
|
endif
|
|
|
|
unlet g:polyglot_disabled_not_set
|
|
endif
|
|
endfunc
|
|
|
|
au VimEnter * call s:verify()
|
|
|
|
" Save polyglot_disabled without postfixes
|
|
if exists('g:polyglot_disabled')
|
|
let g:polyglot_disabled = s:new_polyglot_disabled
|
|
endif
|
|
|
|
" restore Vi compatibility settings
|
|
let &cpo = s:cpo_save |