▶️ Quick Start
git clone https://github.com/qompassai/hyprlua \
~/.local/share/nvim/hyprluaThen in your Neovim lua_ls setup:
require("lspconfig").lua_ls.setup({
settings = {
Lua = {
runtime = { version = "Lua 5.4" },
workspace = {
library = {
vim.fn.expand("~/.local/share/nvim/hyprlua/library"),
},
},
diagnostics = { globals = { "hl" } },
},
},
})🗂️ Addon Structure
hyprlua/ ├── config.jsonc ├── hyprlua.rockspec ├── library/ │ ├── hl.lua │ └── hl.config.lua ├── LICENSES/ │ ├── Apache-2.0.txt │ └── BSD-3-Clause.txt ├── plugin.lua ├── README.md ├── README.pdf └── settings.json
File Purpose library/hl.luaAll runtime types, classes, sub-namespaces ( hl.dsp.*,hl.layout.*,hl.notification.*), and thehlglobal typed asHL.APIlibrary/hl.config.luaHL.ConfigKeyalias +HL.ConfigValueTypeswith concrete return types per keyplugin.lualua_ls OnSetTexthook — pass-through with optional shebang stripping, scoped tohypr*.luaURIshyprlua.rockspecAuthoritative addon manifest using luarocks-build-lls-addonbuild typeconfig.jsoncLegacy config.json-style manifest kept for LLS-Addons registry compatsettings.jsonWorkspace settings for users who add the library path manually LICENSES/Apache-2.0.txtLicense for original Qompass AI contributions LICENSES/BSD-3-Clause.txtRequired upstream attribution for Hyprland-derived stubs
📦 Installation
git clone https://github.com/qompassai/hyprlua \ ~/.local/share/nvim/hyprluaAdd to your
lua_lssetup:-- nvim-lspconfig require("lspconfig").lua_ls.setup({ settings = { Lua = { runtime = { version = "Lua 5.4" }, workspace = { library = { vim.fn.expand("~/.local/share/nvim/hyprlua/library") } }, diagnostics = { globals = { "hl" } }, }, }, }) -- Neovim nightly native LSP (vim.lsp.config) vim.lsp.config("lua_ls", { settings = { Lua = { runtime = { version = "Lua 5.4" }, workspace = { library = { vim.fn.expand("~/.local/share/nvim/hyprlua/library") } }, diagnostics = { globals = { "hl" } }, }, }, })Add to your Hyprland config directory's
.luarc.jsonc:luarocks install hyprluaRequires
luarocks-build-lls-addon. The library path is resolved automatically.Once published to the community registry, enable via:
{ "Lua.addonManager.enable": true }Then install
hyprluafrom the addon manager UI in your editor.
💡 Usage
Full autocomplete, hover docs, and type-checking on the
hlglobal inhyprland.lua:-- hl.get_active_window() → HL.Window|nil (typed, autocompleted) local win = hl.get_active_window() if win then hl.notification.create({ text = win.class, timeout = 3000 }) end -- Typed bind options + dispatcher namespaces hl.bind("SUPER + RETURN", hl.dsp.exec_cmd("kitty"), { description = "Open terminal" }) -- Custom layout — full HL.LayoutContext / HL.LayoutTarget types hl.layout.register("columns", { recalculate = function(ctx) local n = #ctx.targets for i, t in ipairs(ctx.targets) do t:place(ctx.column(i, n)) end end, }) -- HL.EventName alias — all 28 event strings checked + autocompleted hl.on("window.open", function(win) if win.class == "steam" then hl.dispatch(hl.dsp.window.float()) end end) -- HL.ConfigKey alias — 300+ dotted keys, narrowed return types local rounding = hl.get_config("decoration.rounding") -- → integer|booleanWhat you get:
- Autocomplete on all
hl.*functions and sub-namespaces (hl.dsp.*,hl.notification.*,hl.layout.*,hl.plugin.*)HL.EventNamealias — all 28 event strings are checked and completedHL.ConfigKeyalias — 300+ dotted config keys with narrowed return types viaHL.ConfigValueTypes- Typed classes:
HL.Window,HL.Workspace,HL.Monitor,HL.Keybind,HL.Timer,HL.Notification,HL.Group- Hover docs on every method, field, and option table
🧭 About Qompass AI
Matthew A. Porter
Former Intelligence Officer
Educator & Learner
DeepTech Founder & CEO
🔥 How Do I Support
🏛️ Qompass AI Pre-Seed Funding 2023-2025 🏆 Amount 📅 Date RJOS/Zimmer Biomet Research Grant $30,000 March 2024 Pathfinders Intern Program
View on LinkedIn$2,000 October 2024
What a Dual-License Means
This addon uses a dual-license model:
- Apache 2.0 — applies to all original Qompass AI work: EmmyLua/LuaCATS annotations, doc comments, addon structure, Neovim integration, and the rockspec.
- BSD 3-Clause — applies to stub definitions derived from the Hyprland source generator (
scripts/generateLuaStubs.py). This attribution is required and cannot be removed.
Apache 2.0 and BSD 3-Clause are compatible licenses. You may use, modify, and redistribute this addon under either license provided the BSD attribution block is preserved in any file that incorporates upstream-derived stubs.
Full license texts are in LICENSES/Apache-2.0.txt and LICENSES/BSD-3-Clause.txt.
Frequently Asked Questions
A: No. This addon targets the Lua config API introduced in Hyprland 0.55. The old hyprls LSP handled .conf files and is now largely obsolete. If you are still on .conf, no action is needed here.
A: These aliases are defined in hl.lua. Both files must be in the same workspace.library path. The aliases are also re-declared at the top of hl.config.lua as a fallback for lua_ls versions that don't resolve cross-file @meta aliases automatically.
A: Verify diagnostics.globals = { "hl" } is set in your lua_ls settings, or that your .luarc.jsonc in the Hyprland config directory includes "diagnostics": { "globals": ["hl"] }. You can also check :LspLog in Neovim for any path resolution errors.
A: Point programs.neovim.extraLuaConfig or your lua_ls workspace.library at a pkgs.fetchFromGitHub derivation targeting this repo. A flake.nix is planned for a future release.
A: The *.rockspec is the current canonical manifest used by luarocks-build-lls-addon and the LLS addon manager. config.jsonc is kept for legacy compatibility with older LLS-Addons tooling. If you are installing manually via workspace.library, neither file is required on your end.

{ "runtime": { "version": "Lua 5.4" }, "workspace": { "library": ["~/.local/share/nvim/hyprlua/library"], "checkThirdParty": false }, "diagnostics": { "globals": ["hl"], "disable": ["lowercase-global"] } }