svelte-mode
- Emacs major mode specifically designed for
.sveltefiles, based onmhtml-mode - Requires Emacs version 26 or higher
- Supports Svelte directives and blocks
- Integrates with other modes for different languages within Svelte components:
typescript-modefor<script lang="ts">sass-modefor<style lang="sass">pug-modefor<template lang="pug">coffee-modefor<script lang="coffee">
- Works with
emmet-modefor HTML/CSS expansion - Includes JavaScript/CSS as submode in html-mode
Customization options:
svelte-basic-offset: Controls basic indentation level (defaults tosgml-basic-offset)svelte-tag-relative-indent: Whether script/style bodies indent to their tags (default: true)svelte-display-submode-name: Shows active submode in status line (default: false)
Special feature:
Includes a configuration workaround for case-sensitive tag handling, particularly useful for Svelte components that share names with HTML tags (like Link components).
Alternative: For tree-sitter support, see svelte-ts-mode .
sveltemodesyntaxindentemacssvelte-mode
Featured Stories
No featured articles.