mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-10 23:45:31 +00:00
Merge branch 'NotAShelf:main' into feature-language-tex
This commit is contained in:
commit
1d28982b43
4 changed files with 124 additions and 3 deletions
|
|
@ -103,6 +103,7 @@
|
||||||
- `mini.visits`
|
- `mini.visits`
|
||||||
- Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua`
|
- Add [fzf-lua](https://github.com/ibhagwan/fzf-lua) in `vim.fzf-lua`
|
||||||
- Add [rainbow-delimiters](https://github.com/HiPhish/rainbow-delimiters.nvim) in `vim.visuals.rainbow-delimiters`
|
- Add [rainbow-delimiters](https://github.com/HiPhish/rainbow-delimiters.nvim) in `vim.visuals.rainbow-delimiters`
|
||||||
|
- Add options to define highlights under [](#opt-vim.highlight)
|
||||||
|
|
||||||
[kaktu5](https://github.com/kaktu5):
|
[kaktu5](https://github.com/kaktu5):
|
||||||
|
|
||||||
|
|
|
||||||
6
flake.lock
generated
6
flake.lock
generated
|
|
@ -77,11 +77,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1735523292,
|
"lastModified": 1737370608,
|
||||||
"narHash": "sha256-opBsbR/nrGxiiF6XzlVluiHYb6yN/hEwv+lBWTy9xoM=",
|
"narHash": "sha256-hFA6SmioeqvGW/XvZa9bxniAeulksCOcj3kokdNT/YE=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6d97d419e5a9b36e6293887a89a078cf85f5a61b",
|
"rev": "300081d0cc72df578b02d914df941b8ec62240e6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
./basic.nix
|
./basic.nix
|
||||||
./debug.nix
|
./debug.nix
|
||||||
|
./highlight.nix
|
||||||
./spellcheck.nix
|
./spellcheck.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
119
modules/neovim/init/highlight.nix
Normal file
119
modules/neovim/init/highlight.nix
Normal file
|
|
@ -0,0 +1,119 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.types) nullOr attrsOf listOf submodule bool ints str enum;
|
||||||
|
inherit (lib.strings) hasPrefix concatLines;
|
||||||
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
|
inherit (lib.nvim.dag) entryBetween;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.nvim.types) hexColor;
|
||||||
|
|
||||||
|
mkColorOption = target:
|
||||||
|
mkOption {
|
||||||
|
type = nullOr hexColor;
|
||||||
|
default = null;
|
||||||
|
example = "#ebdbb2";
|
||||||
|
description = ''
|
||||||
|
The ${target} color to use. Written as color name or hex "#RRGGBB".
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
mkBoolOption = name:
|
||||||
|
mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
example = false;
|
||||||
|
description = "Whether to enable ${name}";
|
||||||
|
};
|
||||||
|
|
||||||
|
cfg = config.vim.highlight;
|
||||||
|
in {
|
||||||
|
options.vim.highlight = mkOption {
|
||||||
|
type = attrsOf (submodule {
|
||||||
|
# See :h nvim_set_hl
|
||||||
|
options = {
|
||||||
|
bg = mkColorOption "background";
|
||||||
|
fg = mkColorOption "foreground";
|
||||||
|
sp = mkColorOption "special";
|
||||||
|
blend = mkOption {
|
||||||
|
type = nullOr (ints.between 0 100);
|
||||||
|
default = null;
|
||||||
|
description = "Blend as an integer between 0 and 100";
|
||||||
|
};
|
||||||
|
bold = mkBoolOption "bold";
|
||||||
|
standout = mkBoolOption "standout";
|
||||||
|
underline = mkBoolOption "underline";
|
||||||
|
undercurl = mkBoolOption "undercurl";
|
||||||
|
underdouble = mkBoolOption "underdouble";
|
||||||
|
underdotted = mkBoolOption "underdotted";
|
||||||
|
underdashed = mkBoolOption "underdashed";
|
||||||
|
strikethrough = mkBoolOption "strikethrough";
|
||||||
|
italic = mkBoolOption "italic";
|
||||||
|
reverse = mkBoolOption "reverse";
|
||||||
|
nocombine = mkBoolOption "nocombine";
|
||||||
|
link = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "The name of another highlight group to link to";
|
||||||
|
};
|
||||||
|
default = mkOption {
|
||||||
|
type = nullOr bool;
|
||||||
|
default = null;
|
||||||
|
description = "Don't override existing definition";
|
||||||
|
};
|
||||||
|
ctermfg = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "The cterm foreground color to use";
|
||||||
|
};
|
||||||
|
ctermbg = mkOption {
|
||||||
|
type = nullOr str;
|
||||||
|
default = null;
|
||||||
|
description = "The cterm background color to use";
|
||||||
|
};
|
||||||
|
cterm = mkOption {
|
||||||
|
type = nullOr (listOf (enum [
|
||||||
|
"bold"
|
||||||
|
"underline"
|
||||||
|
"undercurl"
|
||||||
|
"underdouble"
|
||||||
|
"underdotted"
|
||||||
|
"underdashed"
|
||||||
|
"strikethrough"
|
||||||
|
"reverse"
|
||||||
|
"inverse"
|
||||||
|
"italic"
|
||||||
|
"standout"
|
||||||
|
"altfont"
|
||||||
|
"nocombine"
|
||||||
|
"NONE"
|
||||||
|
]));
|
||||||
|
default = null;
|
||||||
|
description = "The cterm arguments to use. See ':h highlight-args'";
|
||||||
|
};
|
||||||
|
force = mkBoolOption "force update";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
default = {};
|
||||||
|
example = {
|
||||||
|
SignColumn = {
|
||||||
|
bg = "#282828";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
description = "Custom highlights to apply";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
vim.luaConfigRC.highlight = let
|
||||||
|
highlights =
|
||||||
|
mapAttrsToList (
|
||||||
|
name: value: ''vim.api.nvim_set_hl(0, ${toLuaObject name}, ${toLuaObject value})''
|
||||||
|
)
|
||||||
|
cfg;
|
||||||
|
in
|
||||||
|
entryBetween ["lazyConfigs" "pluginConfigs" "extraPluginConfigs"] ["theme"] (concatLines highlights);
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue