gtkcss-lsp

command module
v0.0.0-...-6322f80 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 10 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL