Code Monkey home page Code Monkey logo

vim-astro's Introduction

Astro support for Vim or Neovim

πŸ§‘β€πŸš€ Not sure what Astro is? See their website at astro.build!

Provides syntax highlighting and indentation support for .astro files.

Theme: Enfocado Dark Neon.

Features

  • Syntax highlighting for embedded languages:
    • JavaScript and JSX.
    • TypeScript and TSX.
    • CSS, SCSS, SASS, and LESS.
    • Stylus (need external support).
  • Indentation (experimental).
  • Code folding.
  • No dependencies from external syntax plugins.
  • Full integration with Vim functions. Read more.

Installation

Install via your preferred package manager. Example using vim-plug:

Plug 'wuelnerdotexe/vim-astro'

alternatively, install manually.

Configuration

The following variables control certain syntax highlighting features. You can add them to your .vimrc or init.vim.

let g:astro_typescript = 'enable'

Enables TypeScript and TSX for .astro files.

Default Value: 'disable'

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 to support it.

Maintainer

Hi πŸ‘‹, I'm Wuelner, a software developer from Guatemala, passionate about creating minimalist solutions using solid fundamentals focused on "how things should be".

Credits

License

MIT Β© Wuelner MartΓ­nez.

With πŸ’– from LATAM to the world!

vim-astro's People

Contributors

wuelnerdotexe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vim-astro's Issues

Include ftplugin

Hello, and thank you for this plugin.

Do you intend this repo to stay focused on indenting and syntax highlighting only or would you be open to also include an extensive ftplugin?

I have been experimenting with Astro at work, which of course involved a bit of tweaking in Vim, and I came up with a pretty clean ftplugin (+ supporting autoloaded functions) that seems to do a good job so far. The content of the ftplugin is a mix of settings pulled from related built-in ftplugins (JavaScript, TypeScript, HTML, CSS, SASS) and Astro-specific settings.

Note: I only use Vim so it is untested in Neovim.

Install Options for nvChad lazy.nvim?

Just getting started with Neovim and this does nothing.

-- custom/plugins.lua
 {
    "wuelnerdotexe/vim-astro"
  },

Well, the plugin seems to be installed but nothing happens.
Hence my assumption that this probably isn't correct.

Not working with Lazy nvim

I tried to install this with lazy.nvim

   return {
	  {
		"wuelnerdotexe/vim-astro",
	  },
    }

It gets installed but syntax is not being highlighted . Should i require this in my init.lua

An error on astro#CollectPathsFromConfig

Every time I open an astro file in Nvim with this plugin, I get an error below.

Error opening file: vim/_editor.lua:0: nvim_exec2()..BufReadPost Autocommands for "*.astro"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[19]..script /Users/(my computer name)/.local/share/nvim/lazy/vim-astro/ftplugin/astro.vim[83]..function astro#CollectPathsFromConfig, line 9: Vim(let):E474: Trailing comma: },   }, }

I guess something is going wrong on this line, but I have no idea what to do to fix the error without fixing my tsconfig.json file.

That error happens when my tsconfig.json has to trail commas like this.

{
  "extends": "astro/tsconfigs/strictest",
  "compilerOptions": {
    "paths": {
      "@components/*": ["./src/components/*"],
      "@layouts/*": ["./src/layouts/*"],
    },
  },
}

The reason why I do not want to modify my tsconfig.json is that I do not actually want my prettier or eslint to remove those trailing commas; it is my project's style to do those.

Do you have any solutions for this?

Performance

Hi, first thanks for putting this plugin together! It's very helpful to have.

I wanted to also report what I think is a performance issue related to the plugin: it seems that when it's installed and detects the Astro filetype scrolling becomes quite choppy. Disable the plugin and the issue goes away.

For context here, I'm using Neovim 0.7.x via tmux 3.2a and kitty 0.25.x. I do have a number of other plugins installed, but this is the first time I've noticed any kind of detectable performance degradation.

If there's any more detail I can provide, I'd be happy to.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.