summaryrefslogtreecommitdiffstats
path: root/README.md
blob: 4c4452ac36f5cf4905b5df576d3f881c51a2a774 (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
244
![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)
- [applescript](https://github.com/mityu/vim-applescript)
- [arduino](https://github.com/sudar/vim-arduino-syntax)
- [asciidoc](https://github.com/asciidoc/vim-asciidoc)
- [autohotkey](https://github.com/hnamikaw/vim-autohotkey)
- [blade](https://github.com/jwalton512/vim-blade)
- [brewfile](https://github.com/bfontaine/Brewfile.vim)
- [c/c++](https://github.com/vim-jp/vim-cpp)
- [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)
- [cmake](https://github.com/pboettch/vim-cmake-syntax)
- [coffee-script](https://github.com/kchmck/vim-coffee-script)
- [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)
- [csv](https://github.com/chrisbra/csv.vim)
- [cucumber](https://github.com/tpope/vim-cucumber)
- [cue](https://github.com/mgrabovsky/vim-cuesheet)
- [dart](https://github.com/dart-lang/dart-vim-plugin)
- [dhall](https://github.com/vmchale/dhall-vim)
- [dlang](https://github.com/JesseKPhillips/d.vim)
- [dockerfile](https://github.com/ekalinin/Dockerfile.vim)
- [elixir](https://github.com/elixir-lang/vim-elixir)
- [elm](https://github.com/andys8/vim-elm-syntax)
- [emberscript](https://github.com/yalesov/vim-ember-script)
- [emblem](https://github.com/yalesov/vim-emblem)
- [erlang](https://github.com/vim-erlang/vim-erlang-runtime)
- [fennel](https://github.com/bakpakin/fennel.vim)
- [ferm](https://github.com/vim-scripts/ferm.vim)
- [fish](https://github.com/georgewitteman/vim-fish)
- [flatbuffers](https://github.com/dcharbon/vim-flatbuffers)
- [fsharp](https://github.com/ionide/Ionide-vim)
- [gdscript](https://github.com/calviken/vim-gdscript3)
- [git](https://github.com/tpope/vim-git)
- [gitignore](https://github.com/fszymanski/fzf-gitignore)
- [glsl](https://github.com/tikhomirov/vim-glsl)
- [gmpl](https://github.com/maelvalais/gmpl.vim)
- [gnuplot](https://github.com/vim-scripts/gnuplot-syntax-highlighting)
- [go](https://github.com/fatih/vim-go)
- [gradle](https://github.com/tfnico/vim-gradle)
- [graphql](https://github.com/jparise/vim-graphql)
- [haml](https://github.com/tpope/vim-haml)
- [handlebars](https://github.com/mustache/vim-mustache-handlebars)
- [haproxy](https://github.com/CH-DanReif/haproxy.vim)
- [haskell](https://github.com/neovimhaskell/haskell-vim)
- [haxe](https://github.com/yaymukund/vim-haxe)
- [hcl](https://github.com/b4b4r07/vim-hcl)
- [helm](https://github.com/towolf/vim-helm)
- [help](https://github.com/neovim/neovim/tree/master/runtime)
- [hive](https://github.com/zebradil/hive.vim)
- [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)
- [ion](https://github.com/vmchale/ion-vim)
- [javascript-sql](https://github.com/statico/vim-javascript-sql)
- [javascript](https://github.com/pangloss/vim-javascript)
- [jenkins](https://github.com/martinda/Jenkinsfile-vim-syntax)
- [jq](https://github.com/vito-c/jq.vim)
- [json5](https://github.com/GutenYe/json5.vim)
- [json](https://github.com/elzr/vim-json)
- [jsonnet](https://github.com/google/vim-jsonnet)
- [jst](https://github.com/briancollins/vim-jst)
- [jsx](https://github.com/MaxMEllon/vim-jsx-pretty)
- [julia](https://github.com/JuliaEditorSupport/julia-vim)
- [kotlin](https://github.com/udalov/kotlin-vim)
- [ledger](https://github.com/ledger/vim-ledger)
- [lilypond](https://github.com/anowlcalledjosh/vim-lilypond)
- [livescript](https://github.com/gkz/vim-ls)
- [llvm](https://github.com/rhysd/vim-llvm)
- [log](https://github.com/MTDL9/vim-log-highlighting)
- [lua](https://github.com/tbastos/vim-lua)
- [mako](https://github.com/sophacles/vim-bundle-mako)
- [markdown](https://github.com/plasticboy/vim-markdown)
- [mathematica](https://github.com/voldikss/vim-mma)
- [mdx](https://github.com/jxnblk/vim-mdx-js)
- [meson](https://github.com/mesonbuild/meson/tree/master/data/syntax-highlighting/vim)
- [moonscript](https://github.com/leafo/moonscript-vim)
- [nginx](https://github.com/chr4/nginx.vim)
- [nim](https://github.com/zah/nim.vim)
- [nix](https://github.com/LnL7/vim-nix)
- [objc](https://github.com/b4winckler/vim-objc)
- [ocaml](https://github.com/rgrinberg/vim-ocaml)
- [octave](https://github.com/McSinyx/vim-octave)
- [odin](https://github.com/Tetralux/odin.vim)
- [opencl](https://github.com/petRUShka/vim-opencl)
- [perl](https://github.com/vim-perl/vim-perl)
- [pgsql](https://github.com/lifepillar/pgsql.vim)
- [php](https://github.com/StanAngeloff/php.vim)
- [plantuml](https://github.com/aklt/plantuml-syntax)
- [pony](https://github.com/jakwings/vim-pony)
- [powershell](https://github.com/PProvost/vim-ps1)
- [protobuf](https://github.com/uarun/vim-protobuf)
- [pug](https://github.com/digitaltoad/vim-pug)
- [puppet](https://github.com/rodjek/vim-puppet)
- [purescript](https://github.com/purescript-contrib/purescript-vim)
- [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)
- [qmake](https://github.com/artoj/qmake-syntax-vim)
- [qml](https://github.com/peterhoeg/vim-qml)
- [r-lang](https://github.com/vim-scripts/R.vim)
- [racket](https://github.com/wlangstroth/vim-racket)
- [ragel](https://github.com/jneen/ragel.vim)
- [raku](https://github.com/Raku/vim-raku)
- [raml](https://github.com/IN3D/vim-raml)
- [razor](https://github.com/adamclerk/vim-razor)
- [reason](https://github.com/reasonml-editor/vim-reason-plus)
- [requirements](https://github.com/raimon49/requirements.txt.vim)
- [rspec](https://github.com/keith/rspec.vim)
- [rst](https://github.com/marshallward/vim-restructuredtext)
- [ruby](https://github.com/vim-ruby/vim-ruby)
- [rust](https://github.com/rust-lang/rust.vim)
- [scala](https://github.com/derekwyatt/vim-scala)
- [scss](https://github.com/cakebaker/scss-syntax.vim)
- [sh](https://github.com/arzg/vim-sh)
- [slim](https://github.com/slim-template/vim-slim)
- [slime](https://github.com/slime-lang/vim-slime-syntax)
- [smt2](https://github.com/bohlender/vim-smt2)
- [solidity](https://github.com/tomlion/vim-solidity)
- [stylus](https://github.com/wavded/vim-stylus)
- [svelte](https://github.com/evanleck/vim-svelte/tree/main)
- [svg-indent](https://github.com/jasonshell/vim-svg-indent)
- [svg](https://github.com/vim-scripts/svg.vim)
- [swift](https://github.com/keith/swift.vim)
- [sxhkd](https://github.com/baskerville/vim-sxhkdrc)
- [systemd](https://github.com/wgwoods/vim-systemd-syntax)
- [textile](https://github.com/timcharper/textile.vim)
- [thrift](https://github.com/solarnz/thrift.vim)
- [tmux](https://github.com/ericpruitt/tmux.vim/tree/master/vim)
- [toml](https://github.com/cespare/vim-toml)
- [tptp](https://github.com/c-cube/vim-tptp)
- [twig](https://github.com/lumiliet/vim-twig)
- [typescript](https://github.com/HerringtonDarkholme/yats.vim)
- [unison](https://github.com/unisonweb/unison/tree/trunk/editor-support/vim)
- [v](https://github.com/ollykel/v-vim)
- [vala](https://github.com/arrufat/vala.vim)
- [vbnet](https://github.com/vim-scripts/vbnet.vim)
- [vcl](https://github.com/smerrill/vcl-vim-plugin)
- [velocity](https://github.com/lepture/vim-velocity)
- [vim](https://github.com/neovim/neovim/tree/master/runtime)
- [vue](https://github.com/posva/vim-vue)
- [xdc](https://github.com/amal-khailtash/vim-xdc-syntax)
- [xml](https://github.com/amadeus/vim-xml)
- [xsl](https://github.com/vim-scripts/XSLT-syntax)
- [yard](https://github.com/noprompt/vim-yardoc)
- [zephir](https://github.com/xwsoul/vim-zephir)
- [zig](https://github.com/ziglang/zig.vim)
- [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.