-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pack): add hyprlang config file language support (#1063)
* feat(pack): add hyprland config file language support * Update lua/astrocommunity/pack/hyprland/init.lua Co-authored-by: Micah Halter <[email protected]> * Update lua/astrocommunity/pack/hyprland/init.lua Co-authored-by: Micah Halter <[email protected]> * Update lua/astrocommunity/pack/hyprland/init.lua Co-authored-by: Micah Halter <[email protected]> * Update lua/astrocommunity/pack/hyprland/init.lua Co-authored-by: Micah Halter <[email protected]> * Update lua/astrocommunity/pack/hyprland/README.md * Update lua/astrocommunity/pack/hyprland/README.md * Update lua/astrocommunity/pack/hyprland/README.md --------- Co-authored-by: Micah Halter <[email protected]>
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# hyprlang Pack | ||
|
||
This plugin pack offers language support for Hyprland config file. It does the following: | ||
|
||
- Adds `hyprlang` filetype which will be assumed from below patterns: | ||
- `*.hl` extension | ||
- `.*/hypr/.*.conf`, `hypr.*.conf` | ||
- Adds `hyprlang` Treesitter parsers | ||
|
||
## Requirement | ||
|
||
- Need to install `hyprls` tool first | ||
- if (mason-tool-installer)[https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim] has been loaded, then hyprls should be | ||
installed automatically | ||
- Execute `:Mason` to install hyprls via mason |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
---@type LazySpec | ||
return { | ||
-- mason ensure install hyprls | ||
{ | ||
"WhoIsSethDaniel/mason-tool-installer.nvim", | ||
optional = true, | ||
opts = function(_, opts) | ||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "hyprls" }) | ||
end, | ||
}, | ||
|
||
{ | ||
"AstroNvim/astrocore", | ||
optional = true, | ||
---@type AstroCoreOpts | ||
opts = { | ||
-- add "hyprlang" file tpye | ||
filetypes = { | ||
extension = { | ||
hl = "hyprlang", | ||
}, | ||
pattern = { | ||
[".*/hypr/.*.conf"] = "hyprlang", | ||
["hypr.*.conf"] = "hyprlang", | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
"AstroNvim/astrolsp", | ||
opts = function(_, opts) | ||
local astrocore = require "astrocore" | ||
opts.servers = astrocore.list_insert_unique(opts.servers, { "hyprls" }) | ||
|
||
return astrocore.extend_tbl(opts, { | ||
config = { | ||
hyprls = { filetypes = { "hyprlang" } }, | ||
}, | ||
}) | ||
end, | ||
}, | ||
-- treesitter support for hyprlang | ||
{ | ||
"nvim-treesitter/nvim-treesitter", | ||
optional = true, | ||
opts = function(_, opts) | ||
if opts.ensure_installed ~= "all" then | ||
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "hyprlang" }) | ||
end | ||
end, | ||
}, | ||
} |