2023-03-02 21:56:06 +03:00
|
|
|
hook global BufCreate .*\.svelte %[
|
|
|
|
set-option buffer filetype svelte
|
2020-10-30 18:29:32 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
hook global WinSetOption filetype=(svelte) %{
|
|
|
|
require-module html
|
|
|
|
|
2020-11-09 11:53:10 +03:00
|
|
|
hook window ModeChange pop:insert:.* -group "svelte-trim-indent" html-trim-indent
|
|
|
|
hook window InsertChar '>' -group "svelte-indent" html-indent-on-greater-than
|
|
|
|
hook window InsertChar \n -group "svelte-indent" html-indent-on-new-line
|
2020-10-30 18:29:32 +03:00
|
|
|
|
|
|
|
hook -once -always window WinSetOption "filetype=.*" "
|
2020-11-09 11:53:10 +03:00
|
|
|
remove-hooks window ""svelte-.+""
|
2020-10-30 18:29:32 +03:00
|
|
|
"
|
|
|
|
}
|
|
|
|
|
|
|
|
hook -group svelte-highlight global WinSetOption filetype=(svelte) %{
|
2020-11-13 01:34:52 +03:00
|
|
|
add-highlighter "window/svelte" ref svelte
|
2020-10-30 18:29:32 +03:00
|
|
|
hook -once -always window WinSetOption "filetype=.*" "
|
2020-11-09 11:53:10 +03:00
|
|
|
remove-highlighter ""window/svelte""
|
2020-10-30 18:29:32 +03:00
|
|
|
"
|
|
|
|
}
|
2020-11-13 01:34:52 +03:00
|
|
|
|
|
|
|
add-highlighter shared/svelte regions
|
|
|
|
add-highlighter shared/svelte/comment region <!-- --> fill comment
|
|
|
|
add-highlighter shared/svelte/tag region < > regions
|
|
|
|
add-highlighter shared/svelte/style region <style\b.*?>\K (?=</style>) ref css
|
|
|
|
add-highlighter shared/svelte/script region <script\b.*?>\K (?=</script>) ref javascript
|
|
|
|
|
|
|
|
add-highlighter shared/svelte/block region \{((#|:|/)\w+)? \} regions
|
|
|
|
add-highlighter shared/svelte/block/ default-region fill meta
|
|
|
|
add-highlighter shared/svelte/block/inner region -recurse \{ \{((#|:|/)\w+)?\K (?=\}) ref javascript
|
|
|
|
|
|
|
|
add-highlighter shared/svelte/tag/base default-region ref html/tag
|
|
|
|
add-highlighter shared/svelte/tag/block region -recurse \{ \{ \} ref svelte/block
|