diff --git a/CHANGELOG.md b/CHANGELOG.md index c2a4ab6..1641fb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.0] - 2022-08-06 + +### Added + +- A new variable is added to enable stylus support. +- Demonstration images are added. + ## [1.0.1] - 2022-08-05 ### Fixed diff --git a/README.md b/README.md index b7690d8..87927b9 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,11 @@ Provides syntax highlighting and indentation (beta) support for `.astro` files. +
+ + Theme: Enfocado Dark Neon. +
+ ## Features - Syntax highlighting for embedded languages: @@ -37,6 +42,16 @@ Enables TypeScript and TSX for `.astro` files. Default Value: 'disable' +```vim +let g:astro_stylus = 'enable' +``` + +Enables Stylus for `.astro` files. + +Default Value: 'disable' + +NOTE: Vim does not provide Stylus support by default, but you can install [vim-stylus](https://github.com/wavded/vim-stylus) to support it. + ## Maintainer > Hi 👋, I'm **[Wuelner](https://linktr.ee/wuelnerdotexe)**, a **software developer from Guatemala**, passionate about creating minimalist solutions using solid fundamentals focused on **"how things should be"**. diff --git a/assets/astro.png b/assets/astro.png new file mode 100644 index 0000000..a5599ab Binary files /dev/null and b/assets/astro.png differ diff --git a/doc/astro.txt b/doc/astro.txt index 8f01580..bd8c9e0 100644 --- a/doc/astro.txt +++ b/doc/astro.txt @@ -13,5 +13,12 @@ Enables TypeScript and TSX for `.astro` files. Default Value: 'disable' +`let g:astro_stylus = 'enable'` + +Enables Stylus for `.astro` files. + +Default Value: 'disable' + +NOTE: You need install a external plugin for support stylus in astro files. ============================================================================== vim:textwidth=78:tabstop=8:filetype=help: diff --git a/syntax/astro.vim b/syntax/astro.vim index 86017f6..f5c9ae2 100644 --- a/syntax/astro.vim +++ b/syntax/astro.vim @@ -20,6 +20,7 @@ endif " Astro syntax variables are initialized. let g:astro_typescript = get(g:, 'astro_typescript', 'disable') +let g:astro_stylus = get(g:, 'astro_stylus', 'disable') let s:cpoptions_save = &cpoptions set cpoptions&vim @@ -141,25 +142,31 @@ unlet b:current_syntax " Embedded Stylus syntax. " NOTE: Vim does not provide stylus support by default, but you can install " this plugin to support it: https://github.com/wavded/vim-stylus -syntax include @astroStylus syntax/stylus.vim +if g:astro_stylus == 'enable' + try + syntax include @astroStylus syntax/stylus.vim -" stylusStyle: add Stylus style tags support in Astro. -syntax region stylusStyle - \ start=/\_[^>]*\(lang\)=\("\|''\)[^\2]*stylus[^\2]*\2\_[^>]*>/ - \ keepend - \ end=""me=s-1 - \ contains=@astroStylus,astroSurroundingTag - \ fold + " stylusStyle: add Stylus style tags support in Astro. + syntax region stylusStyle + \ start=/\_[^>]*\(lang\)=\("\|''\)[^\2]*stylus[^\2]*\2\_[^>]*>/ + \ keepend + \ end=""me=s-1 + \ contains=@astroStylus,astroSurroundingTag + \ fold -unlet b:current_syntax + unlet b:current_syntax -" astroSurroundingTag: add surround HTML tag to script and style. -syntax region astroSurroundingTag - \ start=+<\(script\|style\)+ - \ end=+>+ - \ contains=htmlTagError,htmlTagN,htmlArg,htmlValue,htmlEvent,htmlString - \ contained - \ fold + " astroSurroundingTag: add surround HTML tag to script and style. + syntax region astroSurroundingTag + \ start=+<\(script\|style\)+ + \ end=+>+ + \ contains=htmlTagError,htmlTagN,htmlArg,htmlValue,htmlEvent,htmlString + \ contained + \ fold + catch + echomsg "you need install a external plugin for support stylus in astro files" + endtry +endif " Define the default highlighting. " Only used when an item doesn't have highlighting yet.