mirror of
https://github.com/wuelnerdotexe/vim-astro.git
synced 2025-12-07 01:34:26 +08:00
feat(*): a new config var and an example img are added
This commit is contained in:
@@ -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).
|
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
|
## [1.0.1] - 2022-08-05
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
15
README.md
15
README.md
@@ -4,6 +4,11 @@
|
|||||||
|
|
||||||
Provides syntax highlighting and indentation (beta) support for `.astro` files.
|
Provides syntax highlighting and indentation (beta) support for `.astro` files.
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/wuelnerdotexe/vim-astro/main/assets/astro.png">
|
||||||
|
<strong>Theme:</strong> <a href="https://wuelnerdotexe.github.io/enfocado">Enfocado</a> Dark Neon.
|
||||||
|
</div>
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Syntax highlighting for embedded languages:
|
- Syntax highlighting for embedded languages:
|
||||||
@@ -37,6 +42,16 @@ Enables TypeScript and TSX for `.astro` files.
|
|||||||
|
|
||||||
Default Value: 'disable'
|
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
|
## 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"**.
|
> 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"**.
|
||||||
|
|||||||
BIN
assets/astro.png
Normal file
BIN
assets/astro.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 MiB |
@@ -13,5 +13,12 @@ Enables TypeScript and TSX for `.astro` files.
|
|||||||
|
|
||||||
Default Value: 'disable'
|
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:
|
vim:textwidth=78:tabstop=8:filetype=help:
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ endif
|
|||||||
|
|
||||||
" Astro syntax variables are initialized.
|
" Astro syntax variables are initialized.
|
||||||
let g:astro_typescript = get(g:, 'astro_typescript', 'disable')
|
let g:astro_typescript = get(g:, 'astro_typescript', 'disable')
|
||||||
|
let g:astro_stylus = get(g:, 'astro_stylus', 'disable')
|
||||||
|
|
||||||
let s:cpoptions_save = &cpoptions
|
let s:cpoptions_save = &cpoptions
|
||||||
set cpoptions&vim
|
set cpoptions&vim
|
||||||
@@ -141,25 +142,31 @@ unlet b:current_syntax
|
|||||||
" Embedded Stylus syntax.
|
" Embedded Stylus syntax.
|
||||||
" NOTE: Vim does not provide stylus support by default, but you can install
|
" NOTE: Vim does not provide stylus support by default, but you can install
|
||||||
" this plugin to support it: https://github.com/wavded/vim-stylus
|
" 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.
|
" stylusStyle: add Stylus style tags support in Astro.
|
||||||
syntax region stylusStyle
|
syntax region stylusStyle
|
||||||
\ start=/<style\>\_[^>]*\(lang\)=\("\|''\)[^\2]*stylus[^\2]*\2\_[^>]*>/
|
\ start=/<style\>\_[^>]*\(lang\)=\("\|''\)[^\2]*stylus[^\2]*\2\_[^>]*>/
|
||||||
\ keepend
|
\ keepend
|
||||||
\ end="</style>"me=s-1
|
\ end="</style>"me=s-1
|
||||||
\ contains=@astroStylus,astroSurroundingTag
|
\ contains=@astroStylus,astroSurroundingTag
|
||||||
\ fold
|
\ fold
|
||||||
|
|
||||||
unlet b:current_syntax
|
unlet b:current_syntax
|
||||||
|
|
||||||
" astroSurroundingTag: add surround HTML tag to script and style.
|
" astroSurroundingTag: add surround HTML tag to script and style.
|
||||||
syntax region astroSurroundingTag
|
syntax region astroSurroundingTag
|
||||||
\ start=+<\(script\|style\)+
|
\ start=+<\(script\|style\)+
|
||||||
\ end=+>+
|
\ end=+>+
|
||||||
\ contains=htmlTagError,htmlTagN,htmlArg,htmlValue,htmlEvent,htmlString
|
\ contains=htmlTagError,htmlTagN,htmlArg,htmlValue,htmlEvent,htmlString
|
||||||
\ contained
|
\ contained
|
||||||
\ fold
|
\ fold
|
||||||
|
catch
|
||||||
|
echomsg "you need install a external plugin for support stylus in astro files"
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
|
||||||
" Define the default highlighting.
|
" Define the default highlighting.
|
||||||
" Only used when an item doesn't have highlighting yet.
|
" Only used when an item doesn't have highlighting yet.
|
||||||
|
|||||||
Reference in New Issue
Block a user