Vim syntax highlighting and indentation for Astro
This is mostly just HTML syntax highlighting with some keywords added
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.
The simplest way to install vim-astro is via a package manager like Pathogen, Vundle, NeoBundle, Plug, or minpac.
For example, using minpac:
call minpac#add('rajasegar/vim-astro')
Or using Plug:
Plug 'rajasegar/vim-astro', {'branch': 'main'}
To disable indentation within ---
and <style>
tags, set one of these
variables in your vimrc
:
let g:astro_indent_script = 0
let g:astro_indent_style = 0
- ALE: vim-astro should work out of the box with
eslint
and a few other linters/fixers. PRs welcome if the one you want is missing. - matchit.vim: vim-astro should work out of the box and allow moving
between HTML tags as well as flow control like
#if/:else//if
.
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.