• Stars
    star
    5,419
  • Rank 7,594 (Top 0.2 %)
  • Language
    Vim Script
  • Created about 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A solid language pack for Vim.

This is my top-starred repository on Github, so I've decided to put this ad here:

If you work for big corp and seek consulting, please visit following repository: https://github.com/sheerun/consultation

vim-polyglot

build Maintenance

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 598 packages it consists of.
  • It is also more secure (scripts loaded for every filetype are generated by vim-polyglot)
  • Best syntax and indentation support (no other features). Hand-selected language packs.
  • Automatically detects indentation (includes performance-optimized version of vim-sleuth, can be disabled)

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

Installation

  1. Install Pathogen, Vundle, NeoBundle, or Plug package manager for Vim.
  2. Use this repository as submodule or package.

For example when using Plug (which I recommend):

set nocompatible

call plug#begin()

Plug 'sheerun/vim-polyglot'

call plug#end()

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

Language packs

On top of all language packs from vim repository, vim-polyglot includes:

  • acpiasl (Syntax highlighting for asl and dsl files)
  • ansible
  • apiblueprint (API Blueprint syntax highlighting for apib files)
  • applescript (AppleScript syntax highlighting for applescript and scpt files)
  • arduino (Processing syntax highlighting for pde and ino files)
  • asciidoc (AsciiDoc syntax highlighting for asciidoc, adoc and asc files)
  • autohotkey (AutoHotkey syntax highlighting for ahk and ahkl files)
  • bicep (Syntax highlighting for bicep files)
  • blade (Blade syntax highlighting for blade and blade.php files)
  • brewfile
  • c/c++ (C++ and C syntax highlighting for cpp, c++, cc, cp, cxx and 18 more files)
  • caddyfile
  • carp (Syntax highlighting for carp files)
  • cjsx
  • clojure (Clojure syntax highlighting for clj, bb, boot, cl2, cljc and 6 more files)
  • cmake (CMake syntax highlighting for cmake and cmake.in files)
  • coffee-script (CoffeeScript and Literate CoffeeScript syntax highlighting for coffee, cake, cjsx, iced, coffeekup, cson, litcoffee and coffee.md files)
  • cpp-modern
  • cql (Syntax highlighting for cql files)
  • cryptol (Syntax highlighting for cry, cyl, lcry and lcyl files)
  • crystal (Crystal and HTML+ECR syntax highlighting for cr and ecr files)
  • csv (CSV syntax highlighting for csv, tsv and tab files)
  • cucumber (Gherkin syntax highlighting for feature and story files)
  • cue (Syntax highlighting for cue files)
  • dart (Dart syntax highlighting for dart and drt files)
  • dhall (Dhall syntax highlighting for dhall files)
  • dlang (D syntax highlighting for d, di, lst, dd, ddoc and sdl files)
  • docker-compose
  • elixir (Elixir and HTML+EEX syntax highlighting for ex, exs, eex, html.heex, html.leex and leex files)
  • elm (Elm syntax highlighting for elm files)
  • emberscript (EmberScript syntax highlighting for em and emberscript files)
  • emblem (Syntax highlighting for emblem and em files)
  • erlang (Erlang syntax highlighting for erl, app.src, es, escript, hrl, xrl, yrl, app and yaws files)
  • fennel (Syntax highlighting for fnl files)
  • ferm (Syntax highlighting for ferm files)
  • fish (fish syntax highlighting for fish files)
  • flatbuffers (Syntax highlighting for fbs files)
  • fsharp (F# syntax highlighting for fs, fsi and fsx files)
  • git (Git Config syntax highlighting for gitconfig files)
  • gitignore
  • gleam (Syntax highlighting for gleam files)
  • glsl (GLSL syntax highlighting for glsl, fp, frag, frg, fs and 18 more files)
  • gmpl (Syntax highlighting for mod files)
  • gnuplot (Gnuplot syntax highlighting for gp, gnu, gnuplot, p, plot, plt and gpi files)
  • go (Go syntax highlighting for go and tmpl files)
  • gradle
  • graphql (GraphQL syntax highlighting for graphql, gql and graphqls files)
  • haml (Haml syntax highlighting for haml, haml.deface, hamlc and hamlbars files)
  • handlebars (Mustache and Handlebars syntax highlighting for mustache, hogan, hulk, hjs, handlebars, hbs, hdbs and hb files)
  • haproxy (HAProxy syntax highlighting)
  • haskell (Haskell syntax highlighting for hs, hs-boot, hsc, bpk and hsig files)
  • haxe (Haxe and HXML syntax highlighting for hx, hxsl, hxml and hss files)
  • helm
  • help
  • hive (HiveQL syntax highlighting for q, hql and ql files)
  • hjson (Syntax highlighting for hjson files)
  • html5
  • icalendar (Syntax highlighting for ics files)
  • idris2 (Syntax highlighting for idr, ipkg and lidr files)
  • idris (Idris syntax highlighting for idr and lidr files)
  • ion (Syntax highlighting for ion files)
  • javascript-sql
  • javascript (JavaScript syntax highlighting for js, bones, cjs, es, es6 and 20 more files)
  • jenkins (Syntax highlighting for jenkinsfile and Jenkinsfile files)
  • jq (JSONiq syntax highlighting for jq files)
  • json5 (JSON5 syntax highlighting for json5 files)
  • json (JSON syntax highlighting for json, 4DForm, 4DProject, avsc, geojson and 15 more files)
  • jsonc (Syntax highlighting for cjson and jsonc files)
  • jsonnet (Jsonnet syntax highlighting for jsonnet and libsonnet files)
  • jst (EJS syntax highlighting for ejs, ect, ejs.t and jst files)
  • jsx (Syntax highlighting for jsx files)
  • julia (Julia syntax highlighting for jl files)
  • just (Syntax highlighting for just files)
  • kotlin (Kotlin syntax highlighting for kt, ktm and kts files)
  • ledger (Syntax highlighting for ldg, ledger and journal files)
  • lilypond (LilyPond syntax highlighting for ly and ily files)
  • livescript (LiveScript syntax highlighting for ls files)
  • llvm (LLVM syntax highlighting for ll and td files)
  • log (Syntax highlighting for log and LOG files)
  • lua (Lua syntax highlighting for lua, fcgi, nse, p8, rbxs, rockspec and wlua files)
  • mako (Mako syntax highlighting for mako and mao files)
  • markdown (Markdown syntax highlighting for md, livemd, markdown, mdown, mdwn and 6 more files)
  • mathematica (Mathematica syntax highlighting for mathematica, cdf, m, ma, mt and 6 more files)
  • mdx (Syntax highlighting for mdx files)
  • mermaid (Syntax highlighting for mermaid, mm and mmd files)
  • meson (Meson syntax highlighting for wrap files)
  • mint (Syntax highlighting for mint files)
  • moonscript (MoonScript syntax highlighting for moon files)
  • nftables (Syntax highlighting for nft files)
  • nginx (Nginx syntax highlighting for nginx, nginxconf and vhost files)
  • nim (Nim syntax highlighting for nim, nim.cfg, nimble, nimrod and nims files)
  • nix (Nix syntax highlighting for nix files)
  • objc (Objective-C syntax highlighting for m and h files)
  • ocaml (OCaml syntax highlighting for ml, eliom, eliomi, ml4, mli and 13 more files)
  • octave (Syntax highlighting for oct and m files)
  • odin (Odin syntax highlighting for odin files)
  • opencl (OpenCL syntax highlighting for cl and opencl files)
  • openscad (Syntax highlighting for scad files)
  • org (Syntax highlighting for org files)
  • perl (Perl syntax highlighting for pl, al, cgi, fcgi, perl and 12 more files)
  • pest (Syntax highlighting for pest files)
  • pgsql (PLpgSQL syntax highlighting for pgsql files)
  • php (PHP syntax highlighting for php, aw, ctp, fcgi, inc and 7 more files)
  • plantuml (PlantUML syntax highlighting for puml, iuml, plantuml, uml and pu files)
  • pony (Pony syntax highlighting for pony files)
  • powershell (PowerShell syntax highlighting for ps1, psd1, psm1, pssc and ps1xml files)
  • protobuf (Protocol Buffer syntax highlighting for proto files)
  • pug (Pug syntax highlighting for jade and pug files)
  • puppet (Puppet syntax highlighting for pp and epp files)
  • purescript (PureScript syntax highlighting for purs files)
  • python-compiler
  • python-indent
  • python (Python syntax highlighting for py, cgi, fcgi, gyp, gypi and 14 more files)
  • qmake (QMake syntax highlighting for pro and pri files)
  • qml (QML syntax highlighting for qml and qbs files)
  • r-lang (R syntax highlighting for r, rsx, s, S and rd files)
  • racket (Racket syntax highlighting for rkt, rktd, rktl and scrbl files)
  • ragel (Ragel syntax highlighting for rl files)
  • raku (Raku syntax highlighting for 6pl, 6pm, nqp, p6, p6l and 12 more files)
  • raml (RAML syntax highlighting for raml files)
  • razor (HTML+Razor syntax highlighting for cshtml and razor files)
  • reason (Reason syntax highlighting for re and rei files)
  • requirements (Syntax highlighting for pip files)
  • rspec
  • rst (reStructuredText syntax highlighting for rst, rest, rest.txt and rst.txt files)
  • ruby (Ruby and HTML+ERB syntax highlighting for rb, builder, eye, fcgi, gemspec and 26 more files)
  • rust (Rust syntax highlighting for rs and rs.in files)
  • scala (Scala syntax highlighting for scala, kojo and sc files)
  • scss (SCSS syntax highlighting for scss files)
  • sh (Shell syntax highlighting for sh, bash, bats, cgi, command and 8 more files)
  • slim (Slim syntax highlighting for slim files)
  • slime (Syntax highlighting for slime files)
  • smt2 (SMT syntax highlighting for smt2 and smt files)
  • solidity (Solidity syntax highlighting for sol files)
  • stylus (Stylus syntax highlighting for styl and stylus files)
  • svelte (Svelte syntax highlighting for svelte files)
  • svg-indent
  • svg (SVG syntax highlighting for svg files)
  • sway (Syntax highlighting for swayconfig and sway.config files)
  • swift (Swift syntax highlighting for swift files)
  • sxhkd (Syntax highlighting for sxhkdrc files)
  • systemd (Syntax highlighting for automount, dnssd, link, mount, netdev and 9 more files)
  • terraform (HCL syntax highlighting for tf, tfvars, hcl, nomad and workflow files)
  • textile (Textile syntax highlighting for textile files)
  • thrift (Thrift syntax highlighting for thrift files)
  • tmux
  • toml (TOML syntax highlighting for toml files)
  • tptp (Syntax highlighting for p, tptp and ax files)
  • twig (Twig syntax highlighting for twig and xml.twig files)
  • typescript (TypeScript and TSX syntax highlighting for ts, cts, mts and tsx files)
  • unison (Syntax highlighting for u and uu files)
  • v (V syntax highlighting for v, vv and vsh files)
  • vala (Vala syntax highlighting for vala, vapi and valadoc files)
  • vbnet (Visual Basic .NET syntax highlighting for vb and vbhtml files)
  • vcl (VCL syntax highlighting for vcl files)
  • velocity (Syntax highlighting for vm files)
  • vue (Vue syntax highlighting for vue and wpy files)
  • xdc (Syntax highlighting for xdc files)
  • xml (XML syntax highlighting for xml, adml, admx, ant, axaml and 97 more files)
  • xsl (XSLT syntax highlighting for xslt and xsl files)
  • yard
  • zephir (Zephir syntax highlighting for zep files)
  • zig (Zig syntax highlighting for zir, zig and zir files)
  • zinit

Updating

You can either wait for new patch release with updates or run make by yourself.

Troubleshooting

Please make sure you have set nocompatible in your .vimrc (or use something like sheerun/vimrc)

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

Please declare this variable before polyglot is loaded (at the top of .vimrc)

let g:polyglot_disabled = ['markdown']

The list of available languages to disable is shown above.

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.

Autoindent

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']

Reindent

If you want to disable reindenting of the current line in insert mode (see vim 'indentkeys') you can turn it off with:

autocmd BufEnter * set indentexpr=

This will not affect smart autoindenting when starting a new line.

Default settings

Vim Polyglot sets defaults of some settings that are relevant for good language support. You can disable them by:

let g:polyglot_disabled = ['sensible']

These defaults include:

  • Use utf-8 encoding by default
  • Automatically reload file if changed somewhere else
  • Disable existing swapfile warnings, instead just create multiple swapfiles
  • Don't create swapfiles in current directory, instead in data directory
  • Whitespace characters when using :set list
  • Delete comment character when joining commented lines
  • Search upwards for tags file(s) instead only locally
  • Fix issues with fish shell
  • Increase history size to 1000 items
  • Allow for up to 50 opened tabs on Vim start.
  • Reduce updatetime from 4000 to 300 to avoid issues with coc.nvim
  • Always save upper case variables to viminfo file
  • Don't save options in sessions and views
  • Allow color schemes to do bright colors without forcing bold
  • Load vim's built-in matchit plugin

No ftdetect

If you want to use vim-polyglot plugins, but not ftdetect autocommands, the you can disable it as so:

let g:polyglot_disabled = ['ftdetect']

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.

More Repositories

1

prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
JavaScript
864
star
2

graphqlviz

GraphQL Server schema visualizer
JavaScript
730
star
3

knex-migrate

Modern database migration toolkit for knex.js
JavaScript
342
star
4

bower-away

A tool for migrating away from Bower (to Yarn)
JavaScript
304
star
5

modern-node

All-in-one development toolkit for creating node modules with Jest, Prettier, ESLint, and Standard
JavaScript
242
star
6

dotfiles

Dotfiles meet chocolate and unicorns
Shell
206
star
7

ava-spec

Drop-in BDD helpers for AVA test runner 🎇 [DEPRECATED, please use Jest!]
JavaScript
144
star
8

vimrc

Basic vim configuration for your .vimrc
Vim Script
133
star
9

git-squash

Locally squash commits on a branch without resolving any conflicts (a'la squash and merge)
Shell
129
star
10

dataloader

Dataloader is a generic utility for batch data loading with caching, works great with GraphQL
Ruby
116
star
11

queue

Lightweight, thread-safe, blocking FIFO queue based on auto-resizing circular buffer
Go
70
star
12

extracted-loader

It reloads extracted stylesheets extracted with ExtractTextPlugin
JavaScript
64
star
13

s3_file_field

RETIRED: Please use shrine instead ❤️ http://shrinerb.com/rdoc/files/doc/direct_s3_md.html
Ruby
63
star
14

sublime-wombat-theme

Sublime Text 3 (and 2) theme and color scheme for Hackers
48
star
15

awesome-polish-nlp

Resources for doing NLP in Polish
42
star
16

babel-plugin-file-loader

Like webpack's file-loader, but on server side. Allows for production-grade require('./file.png')
JavaScript
38
star
17

vim-wombat-scheme

Awesome wombat-like scheme for Vim
Vim Script
33
star
18

filelock

Heavily tested, but simple filelocking solution using flock command.
Ruby
30
star
19

rails4-bootstrap

My systematic way of making bullet-proof Rails 4 bootstrap template.
Ruby
21
star
20

npm-packer

🏆 Produces zero-dependencies node modules
JavaScript
17
star
21

githubsocial

Collaborative repository recommendations based on GitHub stars
Ruby
15
star
22

targets-webpack-plugin

Webpack plugin for transcompilig final bundles so they support legacy browsers
JavaScript
15
star
23

cross-run

[DEPRECATED] cross-env now supports npm scripts, please use it instead
JavaScript
9
star
24

git-commit-id

Returns commit id (commit sha) of git repository. Useful for Next.js or Sentry.
JavaScript
6
star
25

external-loader

Webpack loader for easy loading of external modules
JavaScript
5
star
26

rspec-gherkin

A bridge between (in principle) semi-format Gherkin features and formal RSpec features
Ruby
5
star
27

blog

CSS
5
star
28

vim-inspect

Debug Node in Vim with Inspector Protocol
Vim Script
5
star
29

yson

Zero-allocation, human-friendly JSON library for Go
Go
4
star
30

the-global-gitignore

An exhaustive global `.gitignore` file with 775 rules
Makefile
4
star
31

home

Pretty, short, one-line ZSH prompt that makes you feel at home
Shell
3
star
32

retile

Split image into overlaping tiles with similar dimensions
JavaScript
3
star
33

nimjs

Nim
3
star
34

extension-auto-reloader

Reload all development extensions on page refresh
3
star
35

neural-style-server

HTML
3
star
36

puppet-solo

Zero-config puppet executable for OS X and Ubuntu
Shell
3
star
37

csu-88

C-startup (Csu) 88 for MacOS
Assembly
2
star
38

component-map

Not invasive, performant, and garbage collected storage for React components (WeakMap based)
JavaScript
2
star
39

bowered

Bower client that integrates with Sprockets
Ruby
2
star
40

graphql-anywhere

TypeScript
1
star
41

fittastic

Ruby
1
star
42

teleconsole-docker

1
star
43

firebasehelpers

Set of firebase helpers to use for observing values and authentication
Go
1
star
44

bundled-selenium

JavaScript
1
star
45

ping

JavaScript
1
star
46

dockerfiles

Shell
1
star
47

relativistic-ray-tracer

Relativistic Ray Tracer in JavaScript
JavaScript
1
star