gtkcss-lsp
Language server for GTK variables in CSS files.
Description
This project was born out of a slight inconvenience while configuring my Waybar. The problem occurred because CSS language servers like cssls error when trying to use GTK style variables for colors.
This project should, with time, fix those issues.
Features
- Autocompletion for
@define-color variables
Installation
Since the project is written in Go you should be able to easily install the latest release.
go install github.com/NoamNeo/gtkcss-lsp@latest
The Lsp client I developed for was Neovim's lsp client, specifically for Lazyvim. After installing the package you should go to your Neovim config and add this to your autocmd.lua
vim.api.nvim_create_autocmd("FileType", {
pattern = "css",
callback = function(args)
vim.lsp.start({
name = "gtkcss-lsp",
-- Use this is you don't have your ~/go/bin in your $PATH
-- cmd = { vim.fn.expand("~/go/bin/gtkcss-lsp") },
cmd { "gtkcss-lsp" },
root_dir = vim.fs.dirname(path),
})
end,
})
Usage
To use this lsp after installation just open a CSS file and it should work, when you define a variable with @define-color you will have completion results afterwards
License
MIT License