From d9c45819a3b21f2b6a965832e401b1aafefe9179 Mon Sep 17 00:00:00 2001 From: Lyndsy Simon Date: Tue, 2 Jul 2019 12:31:36 -0500 Subject: [PATCH] Add instructions for setting filetype in Vim --- .../blog/2019-04-15-setting-up-your-editor.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/site/content/blog/2019-04-15-setting-up-your-editor.md b/site/content/blog/2019-04-15-setting-up-your-editor.md index c157682e44..291ba6cb64 100644 --- a/site/content/blog/2019-04-15-setting-up-your-editor.md +++ b/site/content/blog/2019-04-15-setting-up-your-editor.md @@ -10,4 +10,18 @@ draft: true * eslint-plugin-svelte3 * svelte-vscode -* associating .svelte files with HTML in VSCode, Sublime, Atom, etc etc etc \ No newline at end of file +* associating .svelte files with HTML in VSCode, Sublime, Atom, etc etc etc + +## Vim/Neovim + +To 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](https://vim.fandom.com/wiki/Modeline_magic): + +