Evergreen-lxl / Evergreen.lxl

🌳 Treesitter support for Lite XL.
MIT License
36 stars 8 forks source link

Evergreen

🌳 Treesitter support for Lite XL.

Evergreen adds Treesitter syntax highlighting support for Lite XL. It is work in progress, but functions well.

Warning Evergreen is only tested on Linux and will definitely not work on Windows.

Showcase

Without Evergreen With Evergreen

Supported Languages

If you want more languages supported, open an issue.

Requirements

Installation

Plugin Manager

Miq

Evergreen can be easily installed with Miq by adding this to your plugin declaration:

{'TorchedSammy/Evergreen.lxl'},

lpm / ppm

Evergreen can be installed using lpm for Lite XL or ppm for Pragtical:

lpm install evergreen
ppm install evergreen

Manual

lua_tree_sitter Installation

Plugin Manager

Plugin managers will handle the installation of the lua_tree_sitter library automatically.

Manual Install

You can download the library from here, and then place it inside the libraries/tree_sitter directory inside your user directory. Rename the binary to init.so.

Usage

To use Evergreen, you have to install the parser for your language of choice. This can be done with the Evergreen: Install command.

The next thing to do is add style variables for the highlighting groups in your config. This can be done like:

local style = require 'core.style'

style.syntax['<name>'] = '#ffffff'

There are a lot of highlight groups to have better control over what specific parts to highlight. This may be overwhelming for some people though, so some of these have aliases to the default Lite XL style variables, and groups like keyword.return will default to the keyword group, conditional.ternary will default to conditional if its set, etc.

Evergreen will warn in the log if there are any groups missing, you can look at this to see what to set to highlight.

These are the available highlight groups:

License

MIT