Merge pull request #1121 from jules-sommer/main
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Treewide Checks / Validate flake (push) Has been cancelled
Treewide Checks / Check formatting (push) Has been cancelled
Treewide Checks / Check source tree for typos (push) Has been cancelled
Treewide Checks / Validate documentation builds (push) Has been cancelled
Treewide Checks / Validate hyperlinks in documentation sources (push) Has been cancelled
Treewide Checks / Validate Editorconfig conformance (push) Has been cancelled
Build and deploy documentation / Check latest commit (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled

ui/nvim-highlight-colors: init
This commit is contained in:
raf 2025-08-31 22:34:45 +03:00 committed by GitHub
commit bf485ab9b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 126 additions and 0 deletions

View file

@ -492,3 +492,10 @@
- Fix default [blink.cmp] sources "path" and "buffer" not working when
`autocomplete.nvim-cmp.enable` was disabled and
`autocomplete.nvim-cmp.sources` had not been modified.
[Jules](https://github.com/jules-sommer):
[nvim-highlight-colors]: https://github.com/brenoprata10/nvim-highlight-colors
- Add [nvim-highlight-colors] plugin in `vim.ui.nvim-highlight-colors` with
`enable` and `setupOpts`

View file

@ -3,6 +3,7 @@
./borders
./breadcrumbs
./colorful-menu-nvim
./nvim-highlight-colors
./colorizer
./fastaction
./illuminate

View file

@ -0,0 +1,28 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.ui.nvim-highlight-colors;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
"nvim-highlight-colors"
];
# enable display of 24-bit RGB colors in neovim
# via the terminal. This is required for nvim-highlight-colors
# to display arbitrary RGB highlights.
options.termguicolors = true;
pluginRC.nvim-highlight-colors = entryAnywhere ''
require('nvim-highlight-colors').setup(${toLuaObject cfg.setupOpts})
'';
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./nvim-highlight-colors.nix
./config.nix
];
}

View file

@ -0,0 +1,71 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption;
inherit (lib.types) attrsOf enum nullOr submodule bool str;
inherit (lib.modules) mkRenamedOptionModule;
inherit (lib.nvim.types) mkPluginSetupOption;
inherit (lib.nvim.config) mkBool;
in {
options.vim.ui.nvim-highlight-colors = {
enable = mkEnableOption "color highlighting [nvim-highlight-colors.lua]";
setupOpts = mkPluginSetupOption "nvim-highlight-colors" {
render = mkOption {
type = enum ["background" "foreground" "virtual"];
default = "background";
example = "virtual";
description = ''
Style to render color highlighting with.
::: {.note}
Each render style works as follows:
- 'background' sets the background
highlight of the matched color string
to the RGB color it describes.
- 'foreground' sets the foreground
highlight of the matched color string
to the RGB color it describes.
- 'virtual' displays the matched color
with virtual text alongside the color
string in the buffer. Virtual text can
be configured to display the color in
various ways, i.e custom virtual symbol
(via `virtual_symbol`) positioning
relative to string, suffix/prefix, etc.
:::
'';
};
virtual_symbol_position = mkOption {
type = enum ["inline" "eol" "eow"];
default = "inline";
example = "eol";
description = ''
Where to render the virtual symbol in
relation to the color string.
::: {.note}
Each render style works as follows:
- 'inline' render virtual text inline,
similar to the style of VSCode color
hinting.
- 'eol' render virtual text at the end
of the line which the color string
occurs (last column). Recommended to
set `virtual_symbol_suffix` to an
empty string when used.
- 'eow' render virtual text at the end
of the word where the color string
occurs. Recommended to set
`virtual_symbol_prefix` to a single
space for padding and the suffix to
an empty string for no padding.
:::
'';
};
};
};
}

View file

@ -1841,6 +1841,19 @@
"url": "https://github.com/amrbashir/nvim-docs-view/archive/a5256fd30417f58804691df174bc76a8c8f8163a.tar.gz",
"hash": "01jc102zzhn1vygjgqqbfbp0q0pjcccpy1113ssmg59p2ckzp1v0"
},
"nvim-highlight-colors": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "brenoprata10",
"repo": "nvim-highlight-colors"
},
"branch": "main",
"submodules": false,
"revision": "1ce0a09bfc28c7274e649d20927cea51e440b65c",
"url": "https://github.com/brenoprata10/nvim-highlight-colors/archive/1ce0a09bfc28c7274e649d20927cea51e440b65c.tar.gz",
"hash": "1wsscm2mycd7zalxv8paa3fk0qy46bbhq4yfr73sl71wvkdh6yjn"
},
"nvim-lightbulb": {
"type": "Git",
"repository": {