A collection of language packs for Vim.
One to rule them all, one to find them, one to bring them all and in the darkness bind them.
- It won't affect your startup time, as scripts are loaded only on demand*.
- It installs and updates 120+ times faster than the 593 packages it consists of.
- It is more secure because scripts loaded for all extensions are generated by vim-polyglot (ftdetect).
- Solid syntax and indentation support (other features skipped). Only the best language packs.
- All unnecessary files are ignored (like enormous documentation from php support).
- Automatically detect indentation (includes performance-optimized version of vim-sleuth)
- Each build is tested by automated vimrunner script on CI. See
specdirectory.
*To be completely honest, optimized ftdetect script takes around 10ms to load.
Installation
- Install Pathogen, Vundle, NeoBundle, or Plug package manager for Vim.
- Use this repository as submodule or package.
For example when using Plug:
Plug 'sheerun/vim-polyglot'
Optionally download one of the releases and unpack it directly under ~/.vim directory.
You can also use Vim 8 built-in package manager:
git clone --depth 1 https://github.com/sheerun/vim-polyglot ~/.vim/pack/plugins/start/vim-polyglot
NOTE: Not all features of individual language packs are available. We strip them from functionality slowing vim startup (for example we ignore plugins folder that is loaded regardless of file type, instead we prefer ftplugin which is loaded lazily).
If you need full functionality of any plugin, please use it directly with your plugin manager.
Language packs
On top of all language packs from vim repository, vim-polyglot includes:
- acpiasl (asl filetype)
- ansible (yaml.ansible filetype)
- apiblueprint (apiblueprint filetype)
- applescript (applescript filetype)
- arduino (arduino filetype)
- asciidoc (asciidoc filetype)
- autohotkey (autohotkey filetype)
- blade (blade filetype)
- brewfile (brewfile filetype)
- c/c++ (cpp, and c filetypes)
- caddyfile (caddyfile filetype)
- carp (carp filetype)
- cjsx
- clojure (clojure filetype)
- cmake (cmake filetype)
- coffee-script (coffee, litcoffe and litcoffee filetypes)
- cpp-modern
- cql (cql filetype)
- cryptol (cryptol filetype)
- crystal (crystal, ecrysta and ecrystal filetypes)
- csv (csv filetype)
- cucumber (cucumber filetype)
- cue (cuesheet filetype)
- dart (dart filetype)
- dhall (dhall filetype)
- dlang (d, dcov, dd, ddoc, dsd and dsdl filetypes)
- dockerfile (yaml.docker-compose filetype)
- elixir (elixir, eelixi and eelixir filetypes)
- elm (elm filetype)
- emberscript (ember-script filetype)
- emblem (emblem filetype)
- erlang (erlang filetype)
- fennel (fennel filetype)
- ferm (ferm filetype)
- fish (fish filetype)
- flatbuffers (fbs filetype)
- fsharp (fsharp filetype)
- gdscript (gdscript3 filetype)
- git (gitconfig, gitrebase, gitsendemail, gitcommi and gitcommit filetypes)
- gitignore (gitignore filetype)
- glsl (glsl filetype)
- gmpl (gmpl filetype)
- gnuplot (gnuplot filetype)
- go (go, gomod, gohtmltmp and gohtmltmpl filetypes)
- gradle
- graphql (graphql filetype)
- haml (haml filetype)
- handlebars (html.mustache, html.handlebar and html.handlebars filetypes)
- haproxy (haproxy filetype)
- haskell (haskell filetype)
- haxe (haxe filetype)
- hcl (hcl filetype)
- helm (helm filetype)
- help (help filetype)
- hive (hive filetype)
- html5
- i3 (i3config filetype)
- icalendar (icalendar filetype)
- idris2 (idris2, lidris and lidris2 filetypes)
- idris (idris filetype)
- ion (ion filetype)
- javascript-sql
- javascript (javascript, flo and flow filetypes)
- jenkins (Jenkinsfile filetype)
- jq (jq filetype)
- json5 (json5 filetype)
- json (json filetype)
- jsonnet (jsonnet filetype)
- jst (jst filetype)
- jsx (javascriptreact filetype)
- julia (julia filetype)
- kotlin (kotlin filetype)
- ledger (ledger filetype)
- lilypond (lilypond filetype)
- livescript (livescript filetype)
- llvm (llvm, tablege and tablegen filetypes)
- log (log filetype)
- lua (lua filetype)
- mako (mako filetype)
- markdown (markdown filetype)
- mathematica (mma filetype)
- mdx (markdown.mdx filetype)
- meson (meson, dosin and dosini filetypes)
- moonscript (moon filetype)
- nginx (nginx filetype)
- nim (nim filetype)
- nix (nix filetype)
- objc (objc filetype)
- ocaml (ocaml, omake, opam, oasis, dune, ocamlbuild_tags, ocpbuild, ocpbuildroot, sexpli and sexplib filetypes)
- octave (octave filetype)
- odin (odin filetype)
- opencl (opencl filetype)
- perl (perl, pod, mason, tt2, tt2html, x and xs filetypes)
- pgsql (sql filetype)
- php (php filetype)
- plantuml (plantuml filetype)
- pony (pony filetype)
- powershell (ps1, ps1xm and ps1xml filetypes)
- protobuf (proto filetype)
- pug (pug filetype)
- puppet (puppet, embeddedpuppe and embeddedpuppet filetypes)
- purescript (purescript filetype)
- python-compiler
- python-indent
- python (python filetype)
- qmake (qmake filetype)
- qml (qml filetype)
- r-lang (r, rhel and rhelp filetypes)
- racket (racket filetype)
- ragel (ragel filetype)
- raku (raku filetype)
- raml (raml filetype)
- razor (razor filetype)
- reason (reason filetype)
- requirements (requirements filetype)
- rspec (ruby filetype)
- rst (rst filetype)
- ruby (ruby, erub and eruby filetypes)
- rust (rust filetype)
- scala (scala filetype)
- scss (scss filetype)
- sh (sh, zs and zsh filetypes)
- slim (slim filetype)
- slime (slime filetype)
- smt2 (smt2 filetype)
- solidity (solidity filetype)
- stylus (stylus filetype)
- svelte (svelte filetype)
- svg-indent
- svg (svg filetype)
- swift (swift filetype)
- sxhkd (sxhkdrc filetype)
- systemd (systemd filetype)
- textile (textile filetype)
- thrift (thrift filetype)
- tmux (tmux filetype)
- toml (toml filetype)
- tptp (tptp filetype)
- twig (html.twig, xml.twi and xml.twig filetypes)
- typescript (typescript, typescriptreac and typescriptreact filetypes)
- unison (unison filetype)
- v (vlang filetype)
- vala (vala filetype)
- vbnet (vbnet filetype)
- vcl (vcl filetype)
- velocity (velocity filetype)
- vue (vue filetype)
- xdc (xdc filetype)
- xml (xml filetype)
- xsl (xsl filetype)
- yard
- zephir (zephir filetype)
- zig (zir, zi and zig filetypes)
- zinit
Updating
You can either wait for new patch release with updates or run make by yourself.
Troubleshooting
Please make sure you have syntax on in your .vimrc (or use something like sheerun/vimrc)
Individual language packs can be disabled by setting g:polyglot_disabled as follows:
let g:polyglot_disabled = ['markdown']
The list of available languages to disable is shown above.
Please declare this variable before polyglot is loaded (at the top of .vimrc)
If you wish to use filetype detection by Vim Polyglot but you'd like to use your own syntax-highlighting plugin, you can append .plugin to disabled entry, like below. Disabling Vim Polyglot filetype plugin won't disable native Vim filetype plugin.
let g:polyglot_disabled = ['markdown.plugin']
Please note that disabling a language won't make in your vim startup any faster / slower (only for specific this specific filetype). All plugins are lazily loaded only when they are really needed.
Vim Polyglot tries to automatically detect indentation settings (just like vim-sleuth). If this feature is not working for you for some reason, please file an issue and disable it temporarily with:
let g:polyglot_disabled = ['autoindent']
Contributing
Language packs are periodically updated using automated scripts/build script.
Feel free to add your language to packages.yaml + heuristics.yaml, and send pull-request. You can run make test to run rough tests. And make dev for easy development.
License
See linked repositories for detailed license information. This repository is MIT-licensed.
