vimtricks.wiki Concise Vim tricks, one at a time.

How do I get language support for many programming languages at once?

Answer

Plug 'sheerun/vim-polyglot'

Explanation

vim-polyglot is a collection of language packs for Vim. It provides syntax highlighting, indentation, and other features for over 100 programming languages.

How it works

  • Install the single plugin
  • Language packs are loaded on demand based on file type
  • Includes syntax files, indent files, and ftplugin files

Example

Plug 'sheerun/vim-polyglot'

After installation, opening any supported file type automatically gets enhanced syntax highlighting.

Tips

  • One plugin replaces dozens of individual language plugins
  • Lazy-loads — only loads the packs you actually use
  • let g:polyglot_disabled = ['markdown'] disables specific languages
  • Updated regularly with new languages and fixes
  • Pairs well with linting plugins like ALE

Next

How do you yank a single word into a named register?