diff options
Diffstat (limited to 'autoload/polyglot')
-rw-r--r-- | autoload/polyglot/detect.vim | 262 | ||||
-rw-r--r-- | autoload/polyglot/shebang.vim | 129 | ||||
-rw-r--r-- | autoload/polyglot/sleuth.vim | 237 |
3 files changed, 628 insertions, 0 deletions
diff --git a/autoload/polyglot/detect.vim b/autoload/polyglot/detect.vim new file mode 100644 index 00000000..e92d4d12 --- /dev/null +++ b/autoload/polyglot/detect.vim @@ -0,0 +1,262 @@ +func! polyglot#detect#Inp() + let line = getline(nextnonblank(1)) + if line =~# '^\*' + set ft=abaqus | return + endif + for lnum in range(1, min([line("$"), 500])) + let line = getline(lnum) + if line =~? '^header surface data' + set ft=trasys | return + endif + endfor +endfunc + +func! polyglot#detect#Asa() + if exists("g:filetype_asa") + let &ft = g:filetype_asa | return + endif + set ft=aspvbs | return +endfunc + +func! polyglot#detect#Asp() + if exists("g:filetype_asp") + let &ft = g:filetype_asp | return + endif + for lnum in range(1, min([line("$"), 3])) + let line = getline(lnum) + if line =~? 'perlscript' + set ft=aspperl | return + endif + endfor + set ft=aspvbs | return +endfunc + +func! polyglot#detect#H() + for lnum in range(1, min([line("$"), 200])) + let line = getline(lnum) + if line =~# '^\s*\(@\(interface\|class\|protocol\|property\|end\|synchronised\|selector\|implementation\)\(\<\|\>\)\|#import\s\+.\+\.h[">]\)' + if exists("g:c_syntax_for_h") + set ft=objc | return + endif + set ft=objcpp | return + endif + endfor + if exists("g:c_syntax_for_h") + set ft=c | return + endif + if exists("g:ch_syntax_for_h") + set ft=ch | return + endif + set ft=cpp | return +endfunc + +func! polyglot#detect#M() + let saw_comment = 0 + for lnum in range(1, min([line("$"), 100])) + let line = getline(lnum) + if line =~# '^\s*/\*' + let saw_comment = 1 + endif + if line =~# '^\s*\(@\(interface\|class\|protocol\|property\|end\|synchronised\|selector\|implementation\)\(\<\|\>\)\|#import\s\+.\+\.h[">]\)' + set ft=objc | return + endif + if line =~# '^\s*%' + set ft=octave | return + endif + if line =~# '^\s*(\*' + set ft=mma | return + endif + if line =~? '^\s*\(\(type\|var\)\(\<\|\>\)\|--\)' + set ft=murphi | return + endif + endfor + if saw_comment + set ft=objc | return + endif + if exists("g:filetype_m") + let &ft = g:filetype_m | return + endif + set ft=octave | return +endfunc + +func! polyglot#detect#Fs() + for lnum in range(1, min([line("$"), 50])) + let line = getline(lnum) + if line =~# '^\(: \|new-device\)' + set ft=forth | return + endif + if line =~# '^\s*\(#light\|import\|let\|module\|namespace\|open\|type\)' + set ft=fsharp | return + endif + if line =~# '\s*\(#version\|precision\|uniform\|varying\|vec[234]\)' + set ft=glsl | return + endif + endfor + if exists("g:filetype_fs") + let &ft = g:filetype_fs | return + endif + set ft=forth | return +endfunc + +func! polyglot#detect#Re() + for lnum in range(1, min([line("$"), 50])) + let line = getline(lnum) + if line =~# '^\s*#\%(\%(if\|ifdef\|define\|pragma\)\s\+\w\|\s*include\s\+[<"]\|template\s*<\)' + set ft=cpp | return + endif + set ft=reason | return + endfor +endfunc + +func! polyglot#detect#Idr() + for lnum in range(1, min([line("$"), 5])) + let line = getline(lnum) + if line =~# '^\s*--.*[Ii]dris \=1' + set ft=idris | return + endif + if line =~# '^\s*--.*[Ii]dris \=2' + set ft=idris2 | return + endif + endfor + for lnum in range(1, min([line("$"), 30])) + let line = getline(lnum) + if line =~# '^pkgs =.*' + set ft=idris | return + endif + if line =~# '^depends =.*' + set ft=idris2 | return + endif + if line =~# '^%language \(TypeProviders\|ElabReflection\)' + set ft=idris | return + endif + if line =~# '^%language PostfixProjections' + set ft=idris2 | return + endif + if line =~# '^%access .*' + set ft=idris | return + endif + endfor + if exists("g:filetype_idr") + let &ft = g:filetype_idr | return + endif + set ft=idris2 | return +endfunc + +func! polyglot#detect#Lidr() + for lnum in range(1, min([line("$"), 200])) + let line = getline(lnum) + if line =~# '^>\s*--.*[Ii]dris \=1' + set ft=lidris | return + endif + endfor + set ft=lidris2 | return +endfunc + +func! polyglot#detect#Bas() + for lnum in range(1, min([line("$"), 5])) + let line = getline(lnum) + if line =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)' + set ft=vb | return + endif + endfor + set ft=basic | return +endfunc + +func! polyglot#detect#Pm() + let line = getline(nextnonblank(1)) + if line =~# 'XPM2' + set ft=xpm2 | return + endif + if line =~# 'XPM' + set ft=xpm | return + endif + for lnum in range(1, min([line("$"), 50])) + let line = getline(lnum) + if line =~# '^\s*\%(use\s\+v6\(\<\|\>\)\|\(\<\|\>\)module\(\<\|\>\)\|\(\<\|\>\)\%(my\s\+\)\=class\(\<\|\>\)\)' + set ft=raku | return + endif + if line =~# '\(\<\|\>\)use\s\+\%(strict\(\<\|\>\)\|v\=5\.\)' + set ft=perl | return + endif + endfor + if exists("g:filetype_pm") + let &ft = g:filetype_pm | return + endif + if polyglot#shebang#Detect() | return | endif + set ft=perl | au! BufWritePost <buffer> ++once call polyglot#detect#Pm() + return +endfunc + +func! polyglot#detect#Pl() + let line = getline(nextnonblank(1)) + if line =~# '^[^#]*:-' || line =~# '^\s*\%(%\|/\*\)' || line =~# '\.\s*$' + set ft=prolog | return + endif + for lnum in range(1, min([line("$"), 50])) + let line = getline(lnum) + if line =~# '^\s*\%(use\s\+v6\(\<\|\>\)\|\(\<\|\>\)module\(\<\|\>\)\|\(\<\|\>\)\%(my\s\+\)\=class\(\<\|\>\)\)' + set ft=raku | return + endif + if line =~# '\(\<\|\>\)use\s\+\%(strict\(\<\|\>\)\|v\=5\.\)' + set ft=perl | return + endif + endfor + if exists("g:filetype_pl") + let &ft = g:filetype_pl | return + endif + if polyglot#shebang#Detect() | return | endif + set ft=perl | au! BufWritePost <buffer> ++once call polyglot#detect#Pl() + return +endfunc + +func! polyglot#detect#T() + for lnum in range(1, min([line("$"), 5])) + let line = getline(lnum) + if line =~# '^\.' + set ft=nroff | return + endif + endfor + for lnum in range(1, min([line("$"), 50])) + let line = getline(lnum) + if line =~# '^\s*\%(use\s\+v6\(\<\|\>\)\|\(\<\|\>\)module\(\<\|\>\)\|\(\<\|\>\)\%(my\s\+\)\=class\(\<\|\>\)\)' + set ft=raku | return + endif + if line =~# '\(\<\|\>\)use\s\+\%(strict\(\<\|\>\)\|v\=5\.\)' + set ft=perl | return + endif + endfor + if exists("g:filetype_t") + let &ft = g:filetype_t | return + endif + if polyglot#shebang#Detect() | return | endif + set ft=perl | au! BufWritePost <buffer> ++once call polyglot#detect#T() + return +endfunc + +func! polyglot#detect#Tt2() + for lnum in range(1, min([line("$"), 3])) + let line = getline(lnum) + if line =~? '<\%(!DOCTYPE HTML\|[%?]\|html\)' + set ft=tt2html | return + endif + endfor + set ft=tt2 | return +endfunc + +func! polyglot#detect#Html() + let line = getline(nextnonblank(1)) + if line =~# '^\(%\|<[%&].*>\)' + set ft=mason | return + endif + for lnum in range(1, min([line("$"), 50])) + let line = getline(lnum) + if line =~# '{%-\=\s*\(end.*\|extends\|block\|macro\|set\|if\|for\|include\|trans\)\(\<\|\>\)\|{#\s\+' + set ft=htmldjango | return + endif + if line =~# '\(\<\|\>\)DTD\s\+XHTML\s' + set ft=xhtml | return + endif + endfor + set ft=html | au! BufWritePost <buffer> ++once call polyglot#detect#Html() + return +endfunc diff --git a/autoload/polyglot/shebang.vim b/autoload/polyglot/shebang.vim new file mode 100644 index 00000000..bf2a793a --- /dev/null +++ b/autoload/polyglot/shebang.vim @@ -0,0 +1,129 @@ +" Please do not edit this file directly, instead modify polyglot.vim or scripts/build + +func! polyglot#shebang#Detect() + let ft = s:Filetype() + if ft != "" + let &ft = ft + endif + + if &ft == "" + runtime! scripts.vim + endif + + return &ft != "" +endfunc + +let s:r_hashbang = '^#!\s*\(\S\+\)\s*\(.*\)\s*' +let s:r_envflag = '%(\S\+=\S\+\|-[iS]\|--ignore-environment\|--split-string\)' +let s:r_env = '^\%(\' . s:r_envflag . '\s\+\)*\(\S\+\)' + +func! s:Filetype() + let l:line1 = getline(1) + + if l:line1 !~# "^#!" + return + endif + + let l:pathrest = matchlist(l:line1, s:r_hashbang) + + if len(l:pathrest) == 0 + return + endif + + let [_, l:path, l:rest; __] = l:pathrest + + let l:script = split(l:path, "/")[-1] + + if l:script == "env" + let l:argspath = matchlist(l:rest, s:r_env) + if len(l:argspath) == 0 + return + endif + + let l:script = l:argspath[1] + endif + + if has_key(s:interpreters, l:script) + return s:interpreters[l:script] + endif + + for interpreter in keys(s:interpreters) + if l:script =~# '^' . interpreter + return s:interpreters[interpreter] + endif + endfor +endfunc + + + +let s:interpreters = { + \ 'osascript': 'applescript', + \ 'tcc': 'c', + \ 'coffee': 'coffee', + \ 'crystal': 'crystal', + \ 'dart': 'dart', + \ 'elixir': 'elixir', + \ 'escript': 'erlang', + \ 'fish': 'fish', + \ 'gnuplot': 'gnuplot', + \ 'groovy': 'groovy', + \ 'runhaskell': 'haskell', + \ 'chakra': 'javascript', + \ 'd8': 'javascript', + \ 'gjs': 'javascript', + \ 'js': 'javascript', + \ 'node': 'javascript', + \ 'nodejs': 'javascript', + \ 'qjs': 'javascript', + \ 'rhino': 'javascript', + \ 'v8': 'javascript', + \ 'v8-shell': 'javascript', + \ 'julia': 'julia', + \ 'lua': 'lua', + \ 'moon': 'moon', + \ 'ocaml': 'ocaml', + \ 'ocamlrun': 'ocaml', + \ 'ocamlscript': 'ocaml', + \ 'cperl': 'perl', + \ 'perl': 'perl', + \ 'php': 'php', + \ 'swipl': 'prolog', + \ 'yap': 'prolog', + \ 'pwsh': 'ps1', + \ 'python': 'python', + \ 'python2': 'python', + \ 'python3': 'python', + \ 'qmake': 'qmake', + \ 'Rscript': 'r', + \ 'racket': 'racket', + \ 'perl6': 'raku', + \ 'raku': 'raku', + \ 'rakudo': 'raku', + \ 'ruby': 'ruby', + \ 'macruby': 'ruby', + \ 'rake': 'ruby', + \ 'jruby': 'ruby', + \ 'rbx': 'ruby', + \ 'scala': 'scala', + \ 'ash': 'sh', + \ 'bash': 'sh', + \ 'dash': 'sh', + \ 'ksh': 'sh', + \ 'mksh': 'sh', + \ 'pdksh': 'sh', + \ 'rc': 'sh', + \ 'sh': 'sh', + \ 'zsh': 'sh', + \ 'boolector': 'smt2', + \ 'cvc4': 'smt2', + \ 'mathsat5': 'smt2', + \ 'opensmt': 'smt2', + \ 'smtinterpol': 'smt2', + \ 'smt-rat': 'smt2', + \ 'stp': 'smt2', + \ 'verit': 'smt2', + \ 'yices2': 'smt2', + \ 'z3': 'smt2', + \ 'deno': 'typescript', + \ 'ts-node': 'typescript', + \ }
\ No newline at end of file diff --git a/autoload/polyglot/sleuth.vim b/autoload/polyglot/sleuth.vim new file mode 100644 index 00000000..d74de687 --- /dev/null +++ b/autoload/polyglot/sleuth.vim @@ -0,0 +1,237 @@ +let s:globs = { + \ '8th': '*.8th', + \ 'Dockerfile': '*.dockerfile,*.dock,*.Dockerfile,Dockerfile,dockerfile,Dockerfile*', + \ 'Jenkinsfile': '*.jenkinsfile,*.Jenkinsfile,Jenkinsfile,Jenkinsfile*', + \ 'a2ps': 'a2psrc,.a2psrc', + \ 'a65': '*.a65', + \ 'aap': '*.aap', + \ 'abap': '*.abap', + \ 'abaqus': '*.inp', + \ 'abc': '*.abc', + \ 'abel': '*.abl', + \ 'acedb': '*.wrm', + \ 'ada': '*.adb,*.ads,*.ada,*.adc,*.gpr,*.ada_m', + \ 'ahdl': '*.tdf', + \ 'aidl': '*.aidl', + \ 'alsaconf': '.asoundrc', + \ 'aml': '*.aml', + \ 'ampl': '*.run', + \ 'ant': 'build.xml', + \ 'apache': '.htaccess,access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf*', + \ 'apiblueprint': '*.apib', + \ 'applescript': '*.applescript,*.scpt', + \ 'aptconf': 'apt.conf', + \ 'arch': '.arch-inventory,=tagging-method', + \ 'arduino': '*.pde,*.ino', + \ 'art': '*.art', + \ 'asciidoc': '*.asciidoc,*.adoc,*.asc', + \ 'asl': '*.asl,*.dsl', + \ 'asn': '*.asn,*.asn1', + \ 'aspperl': '*.asp', + \ 'aspvbs': '*.asa,*.asp', + \ 'atlas': '*.atl,*.as', + \ 'autohotkey': '*.ahk,*.ahkl', + \ 'autoit': '*.au3', + \ 'automake': '[Mm]akefile.am,GNUmakefile.am', + \ 'ave': '*.ave', + \ 'awk': '*.awk,*.gawk', + \ 'basic': '*.basic', + \ 'blade': '*.blade,*.blade.php', + \ 'brewfile': 'Brewfile', + \ 'bzl': '*.bzl,*.bazel,*.BUILD,BUCK,BUILD,BUILD.bazel,Tiltfile,WORKSPACE', + \ 'c': '*.c,*.cats,*.h,*.idc,*.qc', + \ 'caddyfile': 'Caddyfile', + \ 'carp': '*.carp', + \ 'clojure': '*.clj,*.boot,*.cl2,*.cljc,*.cljs,*.cljs.hl,*.cljscm,*.cljx,*.hic,*.edn,riemann.config,build.boot,profile.boot', + \ 'cmake': '*.cmake,*.cmake.in,CMakeLists.txt', + \ 'coffee': '*.coffee,*._coffee,*.cake,*.cjsx,*.iced,*.coffeekup,Cakefile', + \ 'conf': '*.conf,auto.master,config', + \ 'cpp': '*.cpp,*.c++,*.cc,*.cp,*.cxx,*.h,*.h++,*.hh,*.hpp,*.hxx,*.inc,*.inl,*.ipp,*.tcc,*.tpp,*.moc,*.tlh', + \ 'cql': '*.cql', + \ 'cryptol': '*.cry,*.cyl,*.lcry,*.lcyl', + \ 'crystal': '*.cr,Projectfile', + \ 'csv': '*.csv,*.tsv,*.tab', + \ 'cucumber': '*.feature,*.story', + \ 'cuesheet': '*.cue', + \ 'd': '*.d,*.di', + \ 'dart': '*.dart,*.drt', + \ 'dcov': '*.lst', + \ 'dd': '*.dd', + \ 'ddoc': '*.ddoc', + \ 'dhall': '*.dhall', + \ 'dosini': '*.wrap,*.ini,*.dof,*.lektorproject,*.prefs,*.pro,*.properties,buildozer.spec,.editorconfig,.npmrc,php.ini-*', + \ 'dsdl': '*.sdl', + \ 'dune': 'jbuild,dune,dune-project,dune-workspace', + \ 'ecrystal': '*.ecr', + \ 'eelixir': '*.eex,*.leex', + \ 'elf': '*.am', + \ 'elixir': '*.ex,*.exs,mix.lock', + \ 'elm': '*.elm', + \ 'embeddedpuppet': '*.epp', + \ 'ember-script': '*.em,*.emberscript', + \ 'emblem': '*.emblem,*.em', + \ 'erlang': '*.erl,*.app.src,*.es,*.escript,*.hrl,*.xrl,*.yrl,*.app,*.yaws,Emakefile,rebar.config,rebar.config.lock,rebar.lock', + \ 'eruby': '*.erb,*.erb.deface,*.rhtml', + \ 'fbs': '*.fbs', + \ 'fennel': '*.fnl', + \ 'ferm': '*.ferm,ferm.conf', + \ 'fish': '*.fish', + \ 'flow': '*.flow', + \ 'forth': '*.fs,*.ft,*.fth', + \ 'fsharp': '*.fs,*.fsi,*.fsx', + \ 'gdscript3': '*.gd', + \ 'gitcommit': 'COMMIT_EDITMSG,MERGE_MSG,TAG_EDITMSG', + \ 'gitconfig': '*.gitconfig,.gitconfig,.gitmodules', + \ 'gitignore': '.gitignore', + \ 'gitrebase': 'git-rebase-todo', + \ 'gitsendemail': '.gitsendemail.*', + \ 'glsl': '*.glsl,*.fp,*.frag,*.frg,*.fs,*.fsh,*.fshader,*.geo,*.geom,*.glslf,*.glslv,*.gs,*.gshader,*.shader,*.tesc,*.tese,*.vert,*.vrx,*.vsh,*.vshader,*.comp', + \ 'gmpl': '*.mod', + \ 'gnuplot': '*.gp,*.gnu,*.gnuplot,*.p,*.plot,*.plt,*.gpi', + \ 'go': '*.go', + \ 'gohtmltmpl': '*.tmpl', + \ 'gomod': 'go.mod', + \ 'graphql': '*.graphql,*.gql,*.graphqls', + \ 'groovy': '*.groovy,*.grt,*.gtpl,*.gvy,*.gradle,Jenkinsfile', + \ 'grub': '', + \ 'haml': '*.haml,*.haml.deface,*.hamlc,*.hamlbars', + \ 'haproxy': '*.cfg,haproxy.cfg,haproxy*.conf*', + \ 'haskell': '*.hs,*.hs-boot,*.hsc,*.bpk,*.hsig', + \ 'haxe': '*.hx,*.hxsl', + \ 'hcl': '*.hcl,*.nomad,*.workflow,Appfile', + \ 'helm': '', + \ 'help': '', + \ 'hive': '*.q,*.hql,*.ql', + \ 'html': '*.html,*.htm,*.html.hl,*.inc,*.st,*.xht,*.xhtml', + \ 'html.handlebars': '*.handlebars,*.hbs,*.hdbs,*.hb', + \ 'html.mustache': '*.mustache,*.hogan,*.hulk,*.hjs', + \ 'html.twig': '*.twig', + \ 'htmldjango': '*.jinja,*.j2,*.jinja2,*.njk', + \ 'i3config': '*.i3.config,*.i3config,i3.config,i3config,.i3.config,.i3config', + \ 'icalendar': '*.ics', + \ 'idris': '*.idr,*.lidr,idris-response', + \ 'idris2': '*.idr,*.ipkg,idris-response', + \ 'ion': '*.ion', + \ 'javascript': '*.js,*._js,*.bones,*.cjs,*.es,*.es6,*.frag,*.gs,*.jake,*.jsb,*.jscad,*.jsfl,*.jsm,*.jss,*.mjs,*.njs,*.pac,*.sjs,*.ssjs,*.xsjs,*.xsjslib,*.javascript,Jakefile', + \ 'javascriptreact': '*.jsx', + \ 'jq': '*.jq,.jqrc,.jqrc*', + \ 'json': '*.json,*.avsc,*.geojson,*.gltf,*.har,*.ice,*.JSON-tmLanguage,*.jsonl,*.mcmeta,*.tfstate,*.tfstate.backup,*.topojson,*.webapp,*.webmanifest,*.yy,*.yyp,*.jsonp,*.template,.arcconfig,.htmlhintrc,.tern-config,.tern-project,.watchmanconfig,composer.lock,mcmod.info,Pipfile.lock', + \ 'json5': '*.json5', + \ 'jsonnet': '*.jsonnet,*.libsonnet', + \ 'jst': '*.ejs,*.ect,*.jst', + \ 'julia': '*.jl', + \ 'kotlin': '*.kt,*.ktm,*.kts', + \ 'ledger': '*.ldg,*.ledger,*.journal', + \ 'less': '*.less', + \ 'lidris2': '*.lidr', + \ 'lilypond': '*.ly,*.ily', + \ 'litcoffee': '*.litcoffee,*.coffee.md', + \ 'livescript': '*.ls,*._ls,Slakefile', + \ 'llvm': '*.ll', + \ 'log': '*.log,*.LOG,*_log,*_LOG', + \ 'lua': '*.lua,*.fcgi,*.nse,*.p8,*.pd_lua,*.rbxs,*.rockspec,*.wlua,.luacheckrc', + \ 'm4': '*.m4,*.at', + \ 'mako': '*.mako,*.mao', + \ 'markdown': '*.md,*.markdown,*.mdown,*.mdwn,*.mkd,*.mkdn,*.mkdown,*.ronn,*.workbook,contents.lr', + \ 'markdown.mdx': '*.mdx', + \ 'mason': '*.mason,*.mhtml,*.comp', + \ 'meson': 'meson.build,meson_options.txt', + \ 'mma': '*.mathematica,*.cdf,*.m,*.ma,*.mt,*.nb,*.nbp,*.wl,*.wlt,*.wls,*.mma', + \ 'moon': '*.moon', + \ 'murphi': '*.m', + \ 'nginx': '*.nginx,*.nginxconf,*.vhost,nginx.conf,nginx*.conf,*nginx.conf', + \ 'nim': '*.nim,*.nim.cfg,*.nimble,*.nimrod,*.nims,nim.cfg', + \ 'nix': '*.nix', + \ 'oasis': '_oasis', + \ 'objc': '*.m,*.h', + \ 'ocaml': '*.ml,*.eliom,*.eliomi,*.ml4,*.mli,*.mll,*.mly,*.mlt,*.mlp,*.mlip,*.mli.cppo,*.ml.cppo,.ocamlinit', + \ 'ocamlbuild_tags': '_tags', + \ 'ocpbuild': '*.ocp', + \ 'ocpbuildroot': '*.root', + \ 'octave': '*.oct,*.m', + \ 'odin': '*.odin', + \ 'omake': '*.om,OMakefile,OMakeroot,OMakeroot.in', + \ 'opam': '*.opam,*.opam.template,opam', + \ 'opencl': '*.cl,*.opencl', + \ 'perl': '*.pl,*.al,*.cgi,*.fcgi,*.perl,*.ph,*.plx,*.pm,*.psgi,*.t,Makefile.PL,Rexfile,ack,cpanfile,example.gitolite.rc,.gitolite.rc', + \ 'php': '*.php,*.aw,*.ctp,*.fcgi,*.inc,*.php3,*.php4,*.php5,*.phps,*.phpt,*.phtml,.php,.php_cs,.php_cs.dist,Phakefile', + \ 'plantuml': '*.puml,*.iuml,*.plantuml,*.uml,*.pu', + \ 'pod': '*.pod', + \ 'pony': '*.pony', + \ 'prolog': '*.pl,*.pro,*.prolog,*.yap,*.pdb', + \ 'proto': '*.proto', + \ 'ps1': '*.ps1,*.psd1,*.psm1,*.pssc', + \ 'ps1xml': '*.ps1xml', + \ 'pug': '*.jade,*.pug', + \ 'puppet': '*.pp,Modulefile', + \ 'purescript': '*.purs', + \ 'python': '*.py,*.cgi,*.fcgi,*.gyp,*.gypi,*.lmi,*.py3,*.pyde,*.pyi,*.pyp,*.pyt,*.pyw,*.rpy,*.smk,*.spec,*.tac,*.wsgi,*.xpy,*.ptl,.gclient,DEPS,SConscript,SConstruct,Snakefile,wscript,.pythonrc,.pythonstartup', + \ 'qmake': '*.pro,*.pri', + \ 'qml': '*.qml,*.qbs', + \ 'r': '*.r,*.rsx,*.s,*.S,.Rprofile,expr-dist', + \ 'racket': '*.rkt,*.rktd,*.rktl,*.scrbl', + \ 'ragel': '*.rl', + \ 'raku': '*.6pl,*.6pm,*.nqp,*.p6,*.p6l,*.p6m,*.pl,*.pl6,*.pm,*.pm6,*.t,*.rakudoc,*.rakutest,*.raku,*.rakumod,*.pod6,*.t6', + \ 'raml': '*.raml', + \ 'razor': '*.cshtml,*.razor', + \ 'reason': '*.re,*.rei', + \ 'requirements': '*.pip,*requirements.{txt,in},*require.{txt,in},constraints.{txt,in}', + \ 'rhelp': '*.rd', + \ 'rst': '*.rst,*.rest,*.rest.txt,*.rst.txt', + \ 'ruby': '*.rb,*.builder,*.eye,*.fcgi,*.gemspec,*.god,*.jbuilder,*.mspec,*.pluginspec,*.podspec,*.rabl,*.rake,*.rbi,*.rbuild,*.rbw,*.rbx,*.ru,*.ruby,*.spec,*.thor,*.watchr,*.rxml,*.rjs,*.rant,*.axlsx,*.cap,*.opal,.irbrc,.pryrc,.simplecov,Appraisals,Berksfile,Buildfile,Capfile,Dangerfile,Deliverfile,Fastfile,Gemfile,Gemfile.lock,Guardfile,Jarfile,Mavenfile,Podfile,Puppetfile,Rakefile,Snapfile,Thorfile,Vagrantfile,buildfile,Rantfile,.autotest,Cheffile,KitchenSink,Routefile,.Guardfile,.Brewfile,vagrantfile,[Rr]akefile*,*_spec.rb', + \ 'rust': '*.rs,*.rs.in', + \ 'sbt.scala': '*.sbt', + \ 'scala': '*.scala,*.kojo,*.sc', + \ 'scss': '*.scss', + \ 'sexplib': '*.sexp', + \ 'sh': '*.sh,*.bash,*.bats,*.cgi,*.command,*.env,*.fcgi,*.ksh,*.sh.in,*.tmux,*.tool,.bash_aliases,.bash_history,.bash_logout,.bash_profile,.bashrc,.cshrc,.env,.env.example,.flaskenv,.login,.profile,9fs,PKGBUILD,bash_aliases,bash_logout,bash_profile,bashrc,cshrc,gradlew,login,man,profile,zlogin,zlogout,zprofile,zshenv,zshrc', + \ 'slim': '*.slim', + \ 'slime': '*.slime', + \ 'smt2': '*.smt2,*.smt', + \ 'solidity': '*.sol', + \ 'sql': '*.pgsql,*.pls,*.bdy,*.ddl,*.fnc,*.pck,*.pkb,*.pks,*.plb,*.plsql,*.prc,*.spc,*.sql,*.tpb,*.tps,*.trg,*.vw,*.tyb,*.typ,*.tyc', + \ 'stylus': '*.styl,*.stylus', + \ 'svelte': '*.svelte', + \ 'svg': '*.svg', + \ 'swift': '*.swift', + \ 'sxhkdrc': '*.sxhkdrc,sxhkdrc', + \ 'systemd': '*.automount,*.dnssd,*.link,*.mount,*.netdev,*.network,*.nspawn,*.path,*.service,*.slice,*.socket,*.swap,*.target,*.timer,*.#*', + \ 'tablegen': '*.td', + \ 'tads': '*.t', + \ 'terraform': '*.tf,*.tfvars', + \ 'textile': '*.textile', + \ 'thrift': '*.thrift', + \ 'tmux': '.tmux*.conf', + \ 'toml': '*.toml,Cargo.lock,Gopkg.lock,poetry.lock,Pipfile', + \ 'tptp': '*.p,*.tptp,*.ax', + \ 'trasys': '*.inp', + \ 'tt2': '*.tt2', + \ 'tt2html': '*.tt2', + \ 'typescript': '*.ts', + \ 'typescriptreact': '*.tsx', + \ 'unison': '*.u,*.uu', + \ 'v': '*.v', + \ 'vala': '*.vala,*.vapi,*.valadoc', + \ 'vb': '*.bas,*.cls,*.frm,*.frx,*.vba,*.vbs,*.dsm,*.ctl,*.sba', + \ 'vbnet': '*.vb,*.vbhtml', + \ 'vcl': '*.vcl', + \ 'velocity': '*.vm', + \ 'vmasm': '*.mar', + \ 'vue': '*.vue,*.wpy', + \ 'xdc': '*.xdc', + \ 'xml': '*.xml,*.adml,*.admx,*.ant,*.axml,*.builds,*.ccproj,*.ccxml,*.clixml,*.cproject,*.cscfg,*.csdef,*.csl,*.csproj,*.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,*.psc1,*.pt,*.rdf,*.resx,*.rss,*.sch,*.scxml,*.sfproj,*.shproj,*.srdf,*.storyboard,*.sublime-snippet,*.targets,*.tml,*.ui,*.urdf,*.ux,*.vbproj,*.vcxproj,*.vsixmanifest,*.vssettings,*.vstemplate,*.vxml,*.wixproj,*.workflow,*.wsdl,*.wsf,*.wxi,*.wxl,*.wxs,*.x3d,*.xacro,*.xaml,*.xib,*.xlf,*.xliff,*.xmi,*.xml.dist,*.xproj,*.xsd,*.xspec,*.xul,*.zcml,*.cdxml,*.tpm,*.csproj.user,*.wpl,.classpath,.cproject,.project,App.config,NuGet.config,Settings.StyleCop,Web.Debug.config,Web.Release.config,Web.config,packages.config,*fglrxrc', + \ 'xml.twig': '*.xml.twig', + \ 'xs': '*.xs', + \ 'xsl': '*.xslt,*.xsl', + \ 'yaml': '*.yml,*.mir,*.reek,*.rviz,*.sublime-syntax,*.syntax,*.yaml,*.yaml-tmlanguage,*.yaml.sed,*.yml.mysql,.clang-format,.clang-tidy,.gemrc,glide.lock,yarn.lock,fish_history,fish_read_history', + \ 'yaml.ansible': 'playbook.y{a,}ml,site.y{a,}ml,main.y{a,}ml,local.y{a,}ml,requirements.y{a,}ml,tasks.*.y{a,}ml,roles.*.y{a,}ml,handlers.*.y{a,}ml', + \ 'yaml.docker-compose': 'docker-compose*.yaml,docker-compose*.yml', + \ 'zephir': '*.zep', + \ 'zig': '*.zig,*.zir', + \ 'zir': '*.zir', + \ 'zsh': '*.zsh,.zshrc,.zshenv,.zlogin,.zprofile,.zlogout,.zlog*,.zcompdump*,.zfbfmarks,.zsh*', + \} + +func! polyglot#sleuth#GlobForFiletype(type) + return get(s:globs, a:type, '') +endfunc |