summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 6f95df140ee95fa8096b4654a7544e90c6589bb5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
![vim-polyglot](https://i.imgur.com/9RxQK6k.png)

![build](https://github.com/sheerun/vim-polyglot/workflows/Vim%20Polyglot%20CI/badge.svg) [![Maintenance](https://img.shields.io/badge/maintained%20since-2013-yes)]()

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 <!--Package Count-->593<!--/Package Count--> 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](https://github.com/tpope/vim-sleuth))
- Each build is tested by automated vimrunner script on CI. See `spec` directory.

\*To be completely honest, optimized `ftdetect` script takes around `10ms` to load.

## Installation

1. Install [Pathogen](https://github.com/tpope/vim-pathogen), [Vundle](https://github.com/VundleVim/Vundle.vim), [NeoBundle](https://github.com/Shougo/neobundle.vim), or [Plug](https://github.com/junegunn/vim-plug) package manager for Vim.
2. Use this repository as submodule or package.

For example when using [Plug](https://github.com/junegunn/vim-plug):

```
Plug 'sheerun/vim-polyglot'
```

Optionally download one of the [releases](https://github.com/sheerun/vim-polyglot/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](https://github.com/vim/vim/tree/master/runtime), vim-polyglot includes:

<!--Language Packs-->
- [acpiasl](https://github.com/martinlroth/vim-acpi-asl)
- [ansible](https://github.com/pearofducks/ansible-vim)
- [apiblueprint](https://github.com/kylef/apiblueprint.vim) (API Blueprint syntax highlighting)
- [applescript](https://github.com/mityu/vim-applescript) (AppleScript syntax highlighting)
- [arduino](https://github.com/sudar/vim-arduino-syntax) (Processing syntax highlighting)
- [asciidoc](https://github.com/asciidoc/vim-asciidoc) (AsciiDoc syntax highlighting)
- [autohotkey](https://github.com/hnamikaw/vim-autohotkey) (AutoHotkey syntax highlighting)
- [blade](https://github.com/jwalton512/vim-blade) (Blade syntax highlighting)
- [brewfile](https://github.com/bfontaine/Brewfile.vim)
- [c/c++](https://github.com/vim-jp/vim-cpp) (C++ and C syntax highlighting)
- [caddyfile](https://github.com/isobit/vim-caddyfile)
- [carp](https://github.com/hellerve/carp-vim)
- [cjsx](https://github.com/mtscout6/vim-cjsx)
- [clojure](https://github.com/guns/vim-clojure-static) (Clojure syntax highlighting)
- [cmake](https://github.com/pboettch/vim-cmake-syntax) (CMake syntax highlighting)
- [coffee-script](https://github.com/kchmck/vim-coffee-script) (CoffeeScript and Literate CoffeeScript syntax highlighting)
- [cpp-modern](https://github.com/bfrg/vim-cpp-modern)
- [cql](https://github.com/elubow/cql-vim)
- [cryptol](https://github.com/victoredwardocallaghan/cryptol.vim)
- [crystal](https://github.com/rhysd/vim-crystal) (Crystal and HTML+ECR syntax highlighting)
- [csv](https://github.com/chrisbra/csv.vim) (CSV syntax highlighting)
- [cucumber](https://github.com/tpope/vim-cucumber) (Gherkin syntax highlighting)
- [cue](https://github.com/mgrabovsky/vim-cuesheet)
- [dart](https://github.com/dart-lang/dart-vim-plugin) (Dart syntax highlighting)
- [dhall](https://github.com/vmchale/dhall-vim) (Dhall syntax highlighting)
- [dlang](https://github.com/JesseKPhillips/d.vim) (D syntax highlighting)
- [dockerfile](https://github.com/ekalinin/Dockerfile.vim)
- [elixir](https://github.com/elixir-lang/vim-elixir) (Elixir and HTML+EEX syntax highlighting)
- [elm](https://github.com/andys8/vim-elm-syntax) (Elm syntax highlighting)
- [emberscript](https://github.com/yalesov/vim-ember-script) (EmberScript syntax highlighting)
- [emblem](https://github.com/yalesov/vim-emblem)
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime) (Erlang syntax highlighting)
- [fennel](https://github.com/bakpakin/fennel.vim)
- [ferm](https://github.com/vim-scripts/ferm.vim)
- [fish](https://github.com/georgewitteman/vim-fish) (fish syntax highlighting)
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers)
- [fsharp](https://github.com/ionide/Ionide-vim) (F# syntax highlighting)
- [gdscript](https://github.com/calviken/vim-gdscript3) (GDScript syntax highlighting)
- [git](https://github.com/tpope/vim-git) (Git Config syntax highlighting)
- [gitignore](https://github.com/fszymanski/fzf-gitignore)
- [glsl](https://github.com/tikhomirov/vim-glsl) (GLSL syntax highlighting)
- [gmpl](https://github.com/maelvalais/gmpl.vim)
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting) (Gnuplot syntax highlighting)
- [go](https://github.com/fatih/vim-go) (Go syntax highlighting)
- [gradle](https://github.com/tfnico/vim-gradle)
- [graphql](https://github.com/jparise/vim-graphql) (GraphQL syntax highlighting)
- [haml](https://github.com/tpope/vim-haml) (Haml syntax highlighting)
- [handlebars](https://github.com/mustache/vim-mustache-handlebars) (Mustache and Handlebars syntax highlighting)
- [haproxy](https://github.com/CH-DanReif/haproxy.vim) (HAProxy syntax highlighting)
- [haskell](https://github.com/neovimhaskell/haskell-vim) (Haskell syntax highlighting)
- [haxe](https://github.com/yaymukund/vim-haxe) (Haxe syntax highlighting)
- [hcl](https://github.com/b4b4r07/vim-hcl) (HCL syntax highlighting)
- [helm](https://github.com/towolf/vim-helm)
- [help](https://github.com/neovim/neovim/tree/master/runtime)
- [hive](https://github.com/zebradil/hive.vim) (HiveQL syntax highlighting)
- [html5](https://github.com/sheerun/html5.vim)
- [i3](https://github.com/mboughaba/i3config.vim)
- [icalendar](https://github.com/chutzpah/icalendar.vim)
- [idris2](https://github.com/edwinb/idris2-vim)
- [idris](https://github.com/idris-hackers/idris-vim) (Idris syntax highlighting)
- [ion](https://github.com/vmchale/ion-vim)
- [javascript-sql](https://github.com/statico/vim-javascript-sql)
- [javascript](https://github.com/pangloss/vim-javascript) (JavaScript syntax highlighting)
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax)
- [jq](https://github.com/vito-c/jq.vim) (JSONiq syntax highlighting)
- [json5](https://github.com/GutenYe/json5.vim) (JSON5 syntax highlighting)
- [json](https://github.com/elzr/vim-json) (JSON syntax highlighting)
- [jsonnet](https://github.com/google/vim-jsonnet) (Jsonnet syntax highlighting)
- [jst](https://github.com/briancollins/vim-jst) (EJS syntax highlighting)
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty) (JSX syntax highlighting)
- [julia](https://github.com/JuliaEditorSupport/julia-vim) (Julia syntax highlighting)
- [kotlin](https://github.com/udalov/kotlin-vim) (Kotlin syntax highlighting)
- [ledger](https://github.com/ledger/vim-ledger)
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond) (LilyPond syntax highlighting)
- [livescript](https://github.com/gkz/vim-ls) (LiveScript syntax highlighting)
- [llvm](https://github.com/rhysd/vim-llvm) (LLVM syntax highlighting)
- [log](https://github.com/MTDL9/vim-log-highlighting)
- [lua](https://github.com/tbastos/vim-lua) (Lua syntax highlighting)
- [mako](https://github.com/sophacles/vim-bundle-mako) (Mako syntax highlighting)
- [markdown](https://github.com/plasticboy/vim-markdown) (Markdown syntax highlighting)
- [mathematica](https://github.com/voldikss/vim-mma) (Mathematica syntax highlighting)
- [mdx](https://github.com/jxnblk/vim-mdx-js)
- [meson](https://github.com/mesonbuild/meson/tree/master/data/syntax-highlighting/vim) (Meson syntax highlighting)
- [moonscript](https://github.com/leafo/moonscript-vim) (MoonScript syntax highlighting)
- [nginx](https://github.com/chr4/nginx.vim) (Nginx syntax highlighting)
- [nim](https://github.com/zah/nim.vim) (Nim syntax highlighting)
- [nix](https://github.com/LnL7/vim-nix) (Nix syntax highlighting)
- [objc](https://github.com/b4winckler/vim-objc) (Objective-C syntax highlighting)
- [ocaml](https://github.com/rgrinberg/vim-ocaml) (OCaml syntax highlighting)
- [octave](https://github.com/McSinyx/vim-octave)
- [odin](https://github.com/Tetralux/odin.vim) (Odin syntax highlighting)
- [opencl](https://github.com/petRUShka/vim-opencl) (OpenCL syntax highlighting)
- [perl](https://github.com/vim-perl/vim-perl) (Perl syntax highlighting)
- [pgsql](https://github.com/lifepillar/pgsql.vim) (PLpgSQL syntax highlighting)
- [php](https://github.com/StanAngeloff/php.vim) (PHP syntax highlighting)
- [plantuml](https://github.com/aklt/plantuml-syntax) (PlantUML syntax highlighting)
- [pony](https://github.com/jakwings/vim-pony) (Pony syntax highlighting)
- [powershell](https://github.com/PProvost/vim-ps1) (PowerShell syntax highlighting)
- [protobuf](https://github.com/uarun/vim-protobuf) (Protocol Buffer syntax highlighting)
- [pug](https://github.com/digitaltoad/vim-pug) (Pug syntax highlighting)
- [puppet](https://github.com/rodjek/vim-puppet) (Puppet syntax highlighting)
- [purescript](https://github.com/purescript-contrib/purescript-vim) (PureScript syntax highlighting)
- [python-compiler](https://github.com/aliev/vim-compiler-python)
- [python-indent](https://github.com/Vimjas/vim-python-pep8-indent)
- [python](https://github.com/vim-python/python-syntax) (Python syntax highlighting)
- [qmake](https://github.com/artoj/qmake-syntax-vim) (QMake syntax highlighting)
- [qml](https://github.com/peterhoeg/vim-qml) (QML syntax highlighting)
- [r-lang](https://github.com/vim-scripts/R.vim) (R syntax highlighting)
- [racket](https://github.com/wlangstroth/vim-racket) (Racket syntax highlighting)
- [ragel](https://github.com/jneen/ragel.vim) (Ragel syntax highlighting)
- [raku](https://github.com/Raku/vim-raku) (Raku syntax highlighting)
- [raml](https://github.com/IN3D/vim-raml) (RAML syntax highlighting)
- [razor](https://github.com/adamclerk/vim-razor) (HTML+Razor syntax highlighting)
- [reason](https://github.com/reasonml-editor/vim-reason-plus) (Reason syntax highlighting)
- [requirements](https://github.com/raimon49/requirements.txt.vim)
- [rspec](https://github.com/keith/rspec.vim)
- [rst](https://github.com/marshallward/vim-restructuredtext) (reStructuredText syntax highlighting)
- [ruby](https://github.com/vim-ruby/vim-ruby) (Ruby and HTML+ERB syntax highlighting)
- [rust](https://github.com/rust-lang/rust.vim) (Rust syntax highlighting)
- [scala](https://github.com/derekwyatt/vim-scala) (Scala syntax highlighting)
- [scss](https://github.com/cakebaker/scss-syntax.vim) (SCSS syntax highlighting)
- [sh](https://github.com/arzg/vim-sh) (Shell syntax highlighting)
- [slim](https://github.com/slim-template/vim-slim) (Slim syntax highlighting)
- [slime](https://github.com/slime-lang/vim-slime-syntax)
- [smt2](https://github.com/bohlender/vim-smt2) (SMT syntax highlighting)
- [solidity](https://github.com/tomlion/vim-solidity) (Solidity syntax highlighting)
- [stylus](https://github.com/wavded/vim-stylus) (Stylus syntax highlighting)
- [svelte](https://github.com/evanleck/vim-svelte/tree/main) (Svelte syntax highlighting)
- [svg-indent](https://github.com/jasonshell/vim-svg-indent)
- [svg](https://github.com/vim-scripts/svg.vim) (SVG syntax highlighting)
- [swift](https://github.com/keith/swift.vim) (Swift syntax highlighting)
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc)
- [systemd](https://github.com/wgwoods/vim-systemd-syntax)
- [textile](https://github.com/timcharper/textile.vim) (Textile syntax highlighting)
- [thrift](https://github.com/solarnz/thrift.vim) (Thrift syntax highlighting)
- [tmux](https://github.com/ericpruitt/tmux.vim/tree/master/vim)
- [toml](https://github.com/cespare/vim-toml) (TOML syntax highlighting)
- [tptp](https://github.com/c-cube/vim-tptp)
- [twig](https://github.com/lumiliet/vim-twig) (Twig syntax highlighting)
- [typescript](https://github.com/HerringtonDarkholme/yats.vim) (TypeScript and TSX syntax highlighting)
- [unison](https://github.com/unisonweb/unison/tree/trunk/editor-support/vim)
- [v](https://github.com/ollykel/v-vim) (V syntax highlighting)
- [vala](https://github.com/arrufat/vala.vim) (Vala syntax highlighting)
- [vbnet](https://github.com/vim-scripts/vbnet.vim) (Visual Basic .NET syntax highlighting)
- [vcl](https://github.com/smerrill/vcl-vim-plugin) (VCL syntax highlighting)
- [velocity](https://github.com/lepture/vim-velocity)
- [vue](https://github.com/posva/vim-vue) (Vue syntax highlighting)
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax)
- [xml](https://github.com/amadeus/vim-xml) (XML syntax highlighting)
- [xsl](https://github.com/vim-scripts/XSLT-syntax) (XSLT syntax highlighting)
- [yard](https://github.com/noprompt/vim-yardoc)
- [zephir](https://github.com/xwsoul/vim-zephir) (Zephir syntax highlighting)
- [zig](https://github.com/ziglang/zig.vim) (Zig syntax highlighting)
- [zinit](https://github.com/zinit-zsh/zplugin-vim-syntax)
<!--/Language Packs-->

## 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](https://github.com/sheerun/vimrc))

Individual language packs can be disabled by setting `g:polyglot_disabled` as follows:

```vim
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.

```vim
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:

```vim
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.