Vim Svelte screenshot

Vim Svelte

Author Avatar Theme by Evanleck
Updated: 30 May 2025
322 Stars

Vim syntax highlighting and indentation for Svelte 3 components.

Overview:

vim-svelte is a Vim plugin that provides syntax highlighting and indentation for Svelte 3 components. It enhances the HTML syntax highlighting by adding keywords and highlighting JavaScript expressions inside curly braces. It also highlights Svelte-specific keywords and constructs like conditional statements and loops.

Features:

  • HTML syntax highlighting with added keywords and highlighted JavaScript expressions
  • Highlighting of Svelte-specific keywords and constructs like conditionals and loops
  • Support for additional languages with corresponding syntax definitions
  • Customizable list of preprocessed languages
  • Integration with ALE, matchit.vim, and syntastic
  • Indentation tests provided

Installation:

The easiest way to install vim-svelte is through a package manager like Pathogen, Vundle, NeoBundle, Plug, or minpac. Here are examples using minpac and Plug:

Using minpac:

call minpac#add('maxmellon/vim-svelte')

Using Plug:

Plug 'maxmellon/vim-svelte'

If you are already using sheerun/vim-polyglot, vim-svelte’s dependencies (pangloss/vim-javascript and othree/html5.vim) are included, so you do not need to install them separately.

Summary:

vim-svelte is a helpful Vim plugin for Svelte 3 developers that provides enhanced syntax highlighting and indentation for Svelte components. It improves the HTML syntax highlighting with added keywords and highlights JavaScript expressions inside curly braces. It also supports Svelte-specific keywords and constructs like conditionals and loops. The plugin can be easily installed through various package managers and integrates well with other Vim plugins like ALE, matchit.vim, and syntastic. It also provides indentation tests for developers working with Svelte components.