Vim Svelte Plugin screenshot

Vim Svelte Plugin

Author Avatar Theme by Leafoftree
Updated: 7 Apr 2025
147 Stars

Vim syntax and indent plugin for .svelte files

Overview:

The vim-svelte-plugin is a syntax and indent plugin for .svelte files in Vim. It is a fork of the vim-vue-plugin. This plugin combines HTML, CSS, and JavaScript syntax and indent in one file.

Features:

  • HTML, CSS, and JavaScript syntax and indent support in .svelte files
  • Supports Svelte directives
  • Compatibility with other plugins such as vim-pug, vim-coffee-script, typescript-vim or yats.vim
  • Configurable options for enabling/disabling specific language syntax support (pug, coffee, typescript, less, sass)

Installation:

There are multiple ways to install the vim-svelte-plugin:

  1. Using Vundle:

    • Add the following line to your .vimrc file: Plugin 'leafOfTree/vim-svelte-plugin'
    • Run the command :PluginInstall in Vim
  2. Using vim-pathogen:

    • Clone the plugin repository to your Vim bundle directory
    • Restart Vim
  3. Using vim-plug:

    • Add the following line to your .vimrc file: Plug 'leafOfTree/vim-svelte-plugin'
    • Run the command :PlugInstall in Vim
  4. Manual installation:

    • Clone the plugin repository to any directory
    • Add the path to the plugin to Vim’s runtime path (rtp) in your .vimrc file

Remember to set the filetype to ‘svelte’ for this plugin to work correctly. It is recommended to stay up to date by periodically checking for updates, opening issues, or submitting pull requests on the repository.

Summary:

The vim-svelte-plugin is a versatile plugin for editing .svelte files in Vim. It provides syntax and indent support for HTML, CSS, and JavaScript combined in one file. It also supports Svelte directives and can be used alongside other plugins for additional language syntax support. The plugin is easy to install and can be configured to enable or disable specific language syntax support. Staying up to date and contributing to the project is encouraged.