|
| |
|
|
|
A LSP server for Hyprland configuration files.
Not checked means planned / work in progress.
- Auto-complete
- Hover
- TODO: Documentation on hover of categories?
- Go to definition
- Color pickers
- Document symbols
- Diagnostics
- Formatting
- Semantic highlighting
hyprls has packages for various distributions, kindly maintained by other people
go install github.com/hyprland-community/hyprls/cmd/hyprls@latestBinaries for linux are available in Releases
- Required: Just (
paru -S juston Arch Linux (btw))
git clone --recurse-submodules https://github.com/hyprland-community/hyprls
cd hyprls
# installs the binary to ~/.local/bin.
# Make sure that directory exists and is in your PATH
just installCombine with The tree-sitter grammar for Hyprlang for syntax highlighting.
Add this to your init.lua:
-- Hyprlang LSP
vim.api.nvim_create_autocmd({'BufEnter', 'BufWinEnter'}, {
pattern = {"*.hl", "hypr*.conf"},
callback = function(event)
print(string.format("starting hyprls for %s", vim.inspect(event)))
vim.lsp.start {
name = "hyprlang",
cmd = {"hyprls"},
root_dir = vim.fn.getcwd(),
settings = {
hyprls = {
preferIgnoreFile = true, -- set to false to prefer `hyprls.ignore`
ignore = {"hyprlock.conf", "hypridle.conf"}
}
}
}
end
})You can control whether HyprLS prefers a workspace .hyprlsignore file or the editor settings with the hyprls.preferIgnoreFile option. Example configurations:
-
Using
vim.lsp.start(example above) — setsettings.hyprls.preferIgnoreFiletofalseto force the server to usesettings.hyprls.ignore. -
Using
nvim-lspconfig:
local lspconfig = require('lspconfig')
lspconfig.hyprlang.setup{
cmd = {"hyprls"},
settings = {
hyprls = {
preferIgnoreFile = false,
ignore = {"hyprlock.conf", "hypridle.conf"}
}
}
}When preferIgnoreFile is true (the default), HyprLS will read .hyprlsignore from your workspace root. When it's false, it will use the hyprls.ignore array from your editor configuration instead.
Example .hyprlsignore (create this file at the workspace root):
# ignore session-specific files
hyprlock.conf
hypridle.conf
# ignore any file named workspace-specific.ignore
workspace-specific.ignore
Notes for Neovim users:
- If you set
preferIgnoreFile = true, HyprLS will use the workspace.hyprlsignorefile and ignore anysettings.hyprls.ignorevalues passed from Neovim. - If you set
preferIgnoreFile = false, HyprLS will use theignorelist you provide insettings.hyprls(seenvim-lspconfigexample above).
Language server support is provided by the lsp-bridge.
Just install lsp-bridge in Emacs, that's all, no need to do any configuration.
Install it from the marketplace.
Tip
You can use the Hyprland extension pack to also get syntax highlighting.
Install it on OpenVSX
Language server support is provided by the Hyprlang extension. Detailed installation and setup instructions can be found in the extension repository [maintainer = @WhySoBad].
Thanks to @sansmoraxz for this feature ^^
By default, HyprLS ignores hyprlock.conf and hypridle.conf files, since they aren't supported yet.
You can create a .hyprlsignore file that lists filenames HyprLS should not run on. Files are relative to the workspace root, which is determined by your IDE (for example, for VSCode, it's the folder you opened it with)




