svelte-mode
- Emacs major mode specifically designed for
.svelte
files, 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-mode
for<script lang="ts">
sass-mode
for<style lang="sass">
pug-mode
for<template lang="pug">
coffee-mode
for<script lang="coffee">
- Works with
emmet-mode
for 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 here. Navigate to an article, then pick the Feature on menu button