evanleck / vim-svelte Goto Github PK
View Code? Open in Web Editor NEWVim syntax highlighting and indentation for Svelte 3 components.
License: BSD 3-Clause "New" or "Revised" License
Vim syntax highlighting and indentation for Svelte 3 components.
License: BSD 3-Clause "New" or "Revised" License
As title says and another issue is (probably it is caused by vim's html syntax plugin though) when there's tags in a html comment like this (it is a html file but it happens on svelte files too, belive me):
Although, when you close them in comments, it fixes it.
Probably html syntax plugins should skip tags inside comment tags.
Your sincerely.
To reprocude, simply add some attributes to the script tag:
<script lang="ts">
// Pressing S will place cursor here:
let obj = {
|
}
</script>
<script lang="ts">
let obj = {<CR>};
// will place cursor like this:
let obj = {
|
};
</script>
Can't seem to figure out what causes this behavior. I've read indent script and haven't found anything that could mess with it.
Perhaps that's another indent/html.vim
feature for me.
Not sure whether it's a configuration error or something else but I kept on getting Parsing error: Unexpected token <
when I open up any svelte file that starts with <script>
. This is on neovim 0.6 and I do see the filetype is set to svelte already.
Is there a way to change how many spaces make an indent? Currently it seems the default is 2 and it doesn't appear to be configurable.
how do i get it working?
I'm experiencing a strange issue where the syntax highlighting from this plugin is not applied on load. However, if I source my .init.vim
it applies.
https://choosealicense.com/no-permission/
Thanks in advance.
Hi!
I think something is wrong.
<script>
let name;
let text
let yes;
$: document.title = name;
</script>
Hello Evan,
seems that the line is doubled.
Line 25 in 20ea36a
Line 28 in 20ea36a
Due to the comment, maybe "<[a-z]+:[a-zA-Z|]+=" should be "<[a-z]+[A-Z]+[a-zA-Z|]+=" ???
But maybe I've misread it. So if I'm wrong, just delete this Issue.
And I don't understand the | -sign in [a-zA-Z|], so my proposal is probably wrong.
<script>
tag and a closing </script>
tag.<script>
tag%
Cursor jumps to </script>
Cursor does not jump to </script>
Try repeating the same steps with an HTML file. It should work by default. If not run this and then try again:
runtime macros/matchit.vim
Hi. Thanks for the plugin.
I've enabled sass/scss syntax in .svelte files by using: let g:svelte_preprocessors = ['scss', 'sass']
and it looks strange.
It breaks highlighting for <>
in style tag, and breaks highlighting for css properties.
Here's how it should look imo:
I tried to debug and disabled all of my configs and plugins except this,
Plug 'pangloss/vim-javascript'
Plug 'evanleck/vim-svelte'
but it didn't help
Vim version 8.2 (2019 Dec 12, compiled Jun 21 2020 16:11:23) (Arch Linux)
The svelte-preprocess package includes support for preprocessing CSS with PostCSS. Style blocks can be identified with <style lang="postcss">
. With plugins (such as postcss-nested), styles can be nested in the same way they are in SASS.
Alternatively, is there a way to identify a style
block as SASS so that this plugin treats it as such, but without Svelte attempting to process it with that language? If so, I could mark my style blocks as SASS even though I actually use PostCSS.
How to reproduce:
svelte
file type <script>
. Enter. New line will have one-size indentation.import foo from 'foo'
. Enter.Versions:
I suspect it is nothing to do with the vim-svelte
plugin. I use pangloss/vim-javascript
plugin for JS. However, it seems that its up to the vim-svelte
plugin to decide which plugin to use for the <script>
section. If so, a hint in the documentation would be appreciated.
Hi, @evanleck, I get the weird in syntax-highlighting.
syntax on
....
....
Plug 'scrooloose/nerdtree'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'maxboisvert/vim-simple-complete'
Plug 'ktonga/vim-follow-my-lead'
" colorscheme
Plug 'tekannor/ayu-vim'
" ======= Syntax Highlighting ======
Plug 'evanleck/vim-svelte', {'branch': 'main'}
I just use above plugin, and I get something weird if I use svelte inline-function
any suggest
Maybe it's something to do with my particular configuration, do you have it indented?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.