-
-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: refactor imports, prefer adding
helpers
to args rather than i…
…mporting it
- Loading branch information
1 parent
541b694
commit b672470
Showing
160 changed files
with
682 additions
and
721 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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
config, | ||
lib, | ||
config, | ||
pkgs, | ||
... | ||
}: | ||
|
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
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
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 |
---|---|---|
@@ -1,58 +1,57 @@ | ||
{ | ||
config, | ||
lib, | ||
helpers, | ||
config, | ||
... | ||
}: let | ||
helpers = import ../lib/helpers.nix {inherit lib;}; | ||
in | ||
with lib; { | ||
options = { | ||
highlight = mkOption { | ||
type = types.attrsOf helpers.highlightType; | ||
default = {}; | ||
description = "Define highlight groups"; | ||
example = '' | ||
highlight = { | ||
Comment.fg = '#ff0000'; | ||
}; | ||
''; | ||
}; | ||
}: | ||
with lib; { | ||
options = { | ||
highlight = mkOption { | ||
type = types.attrsOf helpers.highlightType; | ||
default = {}; | ||
description = "Define highlight groups"; | ||
example = '' | ||
highlight = { | ||
Comment.fg = '#ff0000'; | ||
}; | ||
''; | ||
}; | ||
|
||
match = mkOption { | ||
type = types.attrsOf types.str; | ||
default = {}; | ||
description = "Define match groups"; | ||
example = '' | ||
match = { | ||
ExtraWhitespace = '\\s\\+$'; | ||
}; | ||
''; | ||
}; | ||
match = mkOption { | ||
type = types.attrsOf types.str; | ||
default = {}; | ||
description = "Define match groups"; | ||
example = '' | ||
match = { | ||
ExtraWhitespace = '\\s\\+$'; | ||
}; | ||
''; | ||
}; | ||
}; | ||
|
||
config = mkIf (config.highlight != {} || config.match != {}) { | ||
extraConfigLuaPost = | ||
(optionalString (config.highlight != {}) '' | ||
-- Highlight groups {{ | ||
do | ||
local highlights = ${helpers.toLuaObject config.highlight} | ||
config = mkIf (config.highlight != {} || config.match != {}) { | ||
extraConfigLuaPost = | ||
(optionalString (config.highlight != {}) '' | ||
-- Highlight groups {{ | ||
for k,v in pairs(highlights) do | ||
vim.api.nvim_set_hl(0, k, v) | ||
end | ||
end | ||
-- }} | ||
'') | ||
+ (optionalString (config.match != {}) '' | ||
-- Match groups {{ | ||
do | ||
local highlights = ${helpers.toLuaObject config.highlight} | ||
local match = ${helpers.toLuaObject config.match} | ||
for k,v in pairs(highlights) do | ||
vim.api.nvim_set_hl(0, k, v) | ||
for k,v in pairs(match) do | ||
vim.fn.matchadd(k, v) | ||
end | ||
end | ||
-- }} | ||
'') | ||
+ (optionalString (config.match != {}) '' | ||
-- Match groups {{ | ||
do | ||
local match = ${helpers.toLuaObject config.match} | ||
for k,v in pairs(match) do | ||
vim.fn.matchadd(k, v) | ||
end | ||
end | ||
-- }} | ||
''); | ||
}; | ||
} | ||
''); | ||
}; | ||
} |
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
config, | ||
lib, | ||
config, | ||
... | ||
}: | ||
with lib; let | ||
|
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
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
{ | ||
pkgs, | ||
config, | ||
lib, | ||
config, | ||
... | ||
}: | ||
with lib; let | ||
|
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.