0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-28 07:52:41 +01:00
svelte/sites/svelte.dev/content/blog/2019-04-15-setting-up-your-editor.md
Puru Vijay 60806f74b9
[feat]: Move svelte.dev here (#8237)
* Push

* Remove `rootDir`

* Use tsconfig instead of jsconfig

* Push recent changes

* Better dark mode

* empty commit to try and trigger a deploy

* bump kit

* Fix site-kit dep

* Comment out blurb

* Update site-kit to 3.2.1

* Externalise sourcemap-codec

* Install sourcemap-codec as dep

---------

Co-authored-by: Rich Harris <hello@rich-harris.dev>
2023-02-02 15:45:09 -05:00

1.8 KiB

title description author authorURL draft
Setting up your editor Instructions for configuring linting and syntax highlighting Rich Harris https://twitter.com/Rich_Harris true

Coming soon

This post will walk you through setting up your editor so that it recognises Svelte files:

  • eslint-plugin-svelte3
  • svelte-vscode
  • associating .svelte files with HTML in VSCode, Sublime, etc.

Atom

To treat *.svelte files as HTML, open Edit → Config... and add the following lines to your core section:

"*":
  core:
    …
    customFileTypes:
	    "text.html.basic": [
        "svelte"
      ]

Vim/Neovim

You can use the coc-svelte extension which utilises the official language-server.

As an alternative you can treat all *.svelte files as HTML. Add the following line to your init.vim:

au! BufNewFile,BufRead *.svelte set ft=html

To temporarily turn on HTML syntax highlighting for the current buffer, use:

:set ft=html

To set the filetype for a single file, use a modeline:

<!-- vim: set ft=html :-->

Visual Studio Code

We recommend using the official Svelte for VS Code extension.

JetBrains WebStorm

The Svelte Framework Integration can be used to add support for Svelte to WebStorm, or other Jetbrains IDEs. Consult the WebStorm plugin installation guide on the JetBrains website for more details.

Sublime Text 3

Open any .svelte file.

Go to View → Syntax → Open all with current extension as... → HTML.