Ⅰ. 插件描述
Vim syntax highlighting and indentation for Svelte 3 components.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'evanleck/vim-svelte-left-unsaid'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'evanleck/vim-svelte-left-unsaid'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'evanleck/vim-svelte-left-unsaid'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/evanleck/vim-svelte
Ⅳ. 文档说明
# vim-svelte
Vim syntax highlighting and indentation for Svelte 3
components.
This is mostly just HTML syntax highlighting with some keywords added and all
expressions inside of { and } highlighted as JavaScript.
Highlighting includes:
- HTML attributes with a colon like
on:clickortransition:fadehighlighted
asKeyword. #if,/if,:else, and:else ifhighlighted asConditional.#await,/await,:catch,:then, and@htmlhighlighted asKeyword.#eachand/eachhighlighted asRepeat.
Dependencies
The JavaScript highlighting depends on
pangloss/vim-javascript. That
ships with sheerun/vim-polyglot so if
you're already using that then you should be set.
Installation
NeoBundle, or
Plug package manager for Vim.
- Use this repository as submodule or package.
For example when using Plug:
Plug 'evanleck/vim-svelte'Options
To disable indentation within <script> and <style> tags, set one of these
variables in your vimrc:
let g:svelte_indent_script = 0
let g:svelte_indent_style = 0Tests
Indentation tests are provided and any contributions would be much appreciated.
They can be run with make test which will clone
vader.vim into the current working
directory and run the test suite.