wuelnerdotexe / vim-astro

Astro language (.astro files) indentation and syntax support in Vim or Neovim. 🚀🧑‍🚀✨
https://www.vim.org/scripts/script.php?script_id=6025
MIT License
177 stars 3 forks source link

Add ftplugin/astro.vim and autoload/astro.vim #3

Closed romainl closed 1 year ago

romainl commented 1 year ago

This pull request adds two files: ftplugin/astro.vim and autoload/astro.vim.

Overview

ftplugin/astro.vim enables/fine-tunes the following features:

autoload/astro.vim hosts the following support functions:

Details

Project-wide navigation

Scoped comment formats

astro#Comments() set comments and commentstring to the appropriate value for the current scope. The implementation honestly looks like it should be slow but it only takes a couple of milliseconds and I didn't notice any performance issue.

I did this for tpope/commentary, which uses commentstring.

Note: it only covers SASS/SCSS/CSS, JS/TS, and HTML at the moment.


Tested in Vim 9.0.270 and Vim 9.0472 on a Mac.