mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-15 15:07:48 +00:00
Merge branch 'main' into notashelf/push-lyuzqwroywyx
This commit is contained in:
commit
0d67745462
22 changed files with 241 additions and 84 deletions
4
.github/workflows/docs-preview.yml
vendored
4
.github/workflows/docs-preview.yml
vendored
|
|
@ -3,7 +3,7 @@ name: Build and Preview Manual
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
types: [opened, synchronize, reopened, closed]
|
types: [opened, synchronize, reopened, labeled, unlabeled, edited]
|
||||||
paths:
|
paths:
|
||||||
- ".github/workflows/docs-preview.yml"
|
- ".github/workflows/docs-preview.yml"
|
||||||
- "modules/**"
|
- "modules/**"
|
||||||
|
|
@ -73,7 +73,7 @@ jobs:
|
||||||
id: prelude
|
id: prelude
|
||||||
run: |
|
run: |
|
||||||
PR_NUMBER=${{ github.event.pull_request.number }}
|
PR_NUMBER=${{ github.event.pull_request.number }}
|
||||||
URL="https://${{ github.repository_owner }}.github.io/nvf/docs-preview-${PR_NUMBER}/"
|
URL="https:///nvf.notashelf.dev/docs-preview-${PR_NUMBER}/"
|
||||||
|
|
||||||
# Propagate non-interpolatable environment vars
|
# Propagate non-interpolatable environment vars
|
||||||
echo "URL=$URL" >> "$GITHUB_OUTPUT"
|
echo "URL=$URL" >> "$GITHUB_OUTPUT"
|
||||||
|
|
|
||||||
1
.github/workflows/manual.yml
vendored
1
.github/workflows/manual.yml
vendored
|
|
@ -59,3 +59,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./public
|
publish_dir: ./public
|
||||||
|
cname: nvf.notashelf.dev
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,9 @@
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
[standalone]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-installation
|
[standalone]: https://nvf.notashelf.dev/#ch-standalone-installation
|
||||||
[NixOS module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-nixos
|
[NixOS module]: https://nvf.notashelf.dev/#ch-standalone-nixos
|
||||||
[Home-Manager module]: https://notashelf.github.io/nvf/index.xhtml#ch-standalone-hm
|
[Home-Manager module]: https://nvf.notashelf.dev/#ch-standalone-hm
|
||||||
[release notes]: https://notashelf.github.io/nvf/release-notes.html
|
[release notes]: https://notashelf.github.io/nvf/release-notes.html
|
||||||
[discussions tab]: https://github.com/notashelf/nvf/discussions
|
[discussions tab]: https://github.com/notashelf/nvf/discussions
|
||||||
[FAQ section]: #frequently-asked-questions
|
[FAQ section]: #frequently-asked-questions
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,5 @@ release-notes/rl-0.5.md
|
||||||
release-notes/rl-0.6.md
|
release-notes/rl-0.6.md
|
||||||
release-notes/rl-0.7.md
|
release-notes/rl-0.7.md
|
||||||
release-notes/rl-0.8.md
|
release-notes/rl-0.8.md
|
||||||
|
release-notes/rl-0.9.md
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,40 @@
|
||||||
|
|
||||||
## Changelog {#sec-release-0-9-changelog}
|
## Changelog {#sec-release-0-9-changelog}
|
||||||
|
|
||||||
|
## Breaking changes
|
||||||
|
|
||||||
|
- Nixpkgs merged a full and incompatible rewrite of vimPlugins.nvim-treesitter.
|
||||||
|
The changes affected how grammars are built and it caused issues when neovim
|
||||||
|
attempted to load languages and could not find files in expected locations.
|
||||||
|
|
||||||
|
## Changelog {#sec-release-0-9-changelog}
|
||||||
|
|
||||||
|
[suimong](https://github.com/suimong):
|
||||||
|
|
||||||
|
- Fix `vim.tabline.nvimBufferline` where `setupOpts.options.hover` requires
|
||||||
|
`vim.opt.mousemoveevent` to be set.
|
||||||
|
|
||||||
|
[thamenato](https://github.com/thamenato):
|
||||||
|
|
||||||
|
- Attempt to adapt nvim-treesitter to (breaking) Nixpkgs changes. Some treesitte grammars
|
||||||
|
were changed to prefer `grammarPlugins` over `builtGrammars`.
|
||||||
|
|
||||||
|
[jfeo](https://github.com/jfeo):
|
||||||
|
|
||||||
|
[ccc.nvim]: https://github.com/uga-rosa/ccc.nvim
|
||||||
|
|
||||||
|
- Added [ccc.nvim] option {option}`vim.utility.ccc.setupOpts` with the existing
|
||||||
|
hard-coded options as default values.
|
||||||
|
|
||||||
[Ring-A-Ding-Ding-Baby](https://github.com/Ring-A-Ding-Ding-Baby):
|
[Ring-A-Ding-Ding-Baby](https://github.com/Ring-A-Ding-Ding-Baby):
|
||||||
|
|
||||||
|
|
||||||
- Aligned `codelldb` adapter setup with [rustaceanvim]’s built-in logic.
|
- Aligned `codelldb` adapter setup with [rustaceanvim]’s built-in logic.
|
||||||
- Added `languages.rust.dap.backend` option to choose between `codelldb` and
|
- Added `languages.rust.dap.backend` option to choose between `codelldb` and
|
||||||
`lldb-dap` adapters.
|
`lldb-dap` adapters.
|
||||||
|
|
||||||
|
[Libadoxon](https://github.com/Libadoxon):
|
||||||
|
|
||||||
|
- `toggleterm` open map now also works when in terminal mode
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
28
flake.lock
generated
28
flake.lock
generated
|
|
@ -53,7 +53,9 @@
|
||||||
},
|
},
|
||||||
"ndg": {
|
"ndg": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765720983,
|
"lastModified": 1765720983,
|
||||||
|
|
@ -71,27 +73,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1764242076,
|
"lastModified": 1767364772,
|
||||||
"narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=",
|
"narHash": "sha256-fFUnEYMla8b7UKjijLnMe+oVFOz6HjijGGNS1l7dYaQ=",
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "2fad6eac6077f03fe109c4d4eb171cf96791faa4",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1764081664,
|
|
||||||
"narHash": "sha256-sUoHmPr/EwXzRMpv1u/kH+dXuvJEyyF2Q7muE+t0EU4=",
|
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "dc205f7b4fdb04c8b7877b43edb7b73be7730081",
|
"rev": "16c7794d0a28b5a37904d55bcca36003b9109aaa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -107,7 +93,7 @@
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"mnw": "mnw",
|
"mnw": "mnw",
|
||||||
"ndg": "ndg",
|
"ndg": "ndg",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs",
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,9 @@
|
||||||
mnw.url = "github:Gerg-L/mnw";
|
mnw.url = "github:Gerg-L/mnw";
|
||||||
|
|
||||||
# Alternative documentation generator
|
# Alternative documentation generator
|
||||||
ndg.url = "github:feel-co/ndg";
|
ndg = {
|
||||||
|
url = "github:feel-co/ndg";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
mkGrammarOption = pkgs: grammar:
|
mkGrammarOption = pkgs: grammar:
|
||||||
mkPackageOption pkgs ["${grammar} treesitter"] {
|
mkPackageOption pkgs ["${grammar} treesitter"] {
|
||||||
default = ["vimPlugins" "nvim-treesitter" "builtGrammars" grammar];
|
default = ["vimPlugins" "nvim-treesitter" "grammarPlugins" grammar];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
inherit diagnostics diagnosticSubmodule mkGrammarOption;
|
inherit diagnostics diagnosticSubmodule mkGrammarOption;
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ in {
|
||||||
|
|
||||||
treesitter = {
|
treesitter = {
|
||||||
enable = mkEnableOption "C# treesitter" // {default = config.vim.languages.enableTreesitter;};
|
enable = mkEnableOption "C# treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
package = mkGrammarOption pkgs "c-sharp";
|
package = mkGrammarOption pkgs "c_sharp";
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ in {
|
||||||
description = "Enable Markdown treesitter";
|
description = "Enable Markdown treesitter";
|
||||||
};
|
};
|
||||||
mdPackage = mkGrammarOption pkgs "markdown";
|
mdPackage = mkGrammarOption pkgs "markdown";
|
||||||
mdInlinePackage = mkGrammarOption pkgs "markdown-inline";
|
mdInlinePackage = mkGrammarOption pkgs "markdown_inline";
|
||||||
};
|
};
|
||||||
|
|
||||||
lsp = {
|
lsp = {
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@ in {
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
description = "Python treesitter grammar to use";
|
description = "Python treesitter grammar to use";
|
||||||
type = package;
|
type = package;
|
||||||
default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.python;
|
default = pkgs.vimPlugins.nvim-treesitter.grammarPlugins.python;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ in {
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = package;
|
type = package;
|
||||||
default = pkgs.vimPlugins.nvim-treesitter.builtGrammars.sql;
|
default = pkgs.vimPlugins.nvim-treesitter.grammarPlugins.sql;
|
||||||
description = "SQL treesitter grammar to use";
|
description = "SQL treesitter grammar to use";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ in {
|
||||||
|
|
||||||
pluginRC.orgmode = entryAnywhere ''
|
pluginRC.orgmode = entryAnywhere ''
|
||||||
-- Treesitter configuration
|
-- Treesitter configuration
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.config').setup {
|
||||||
|
|
||||||
-- If TS highlights are not enabled at all, or disabled via `disable` prop,
|
-- If TS highlights are not enabled at all, or disabled via `disable` prop,
|
||||||
-- highlighting will fallback to default Vim syntax highlighting
|
-- highlighting will fallback to default Vim syntax highlighting
|
||||||
|
|
|
||||||
|
|
@ -24,15 +24,33 @@ in {
|
||||||
# Recommended by upstream, so enabled here.
|
# Recommended by upstream, so enabled here.
|
||||||
visuals.nvim-web-devicons.enable = true;
|
visuals.nvim-web-devicons.enable = true;
|
||||||
|
|
||||||
|
# See `:help bufferline-hover-events`
|
||||||
|
options = mkIf cfg.setupOpts.options.hover.enabled {
|
||||||
|
mousemoveevent = true;
|
||||||
|
};
|
||||||
|
|
||||||
maps.normal = mkMerge [
|
maps.normal = mkMerge [
|
||||||
(mkLuaBinding cfg.mappings.closeCurrent "require(\"bufdelete\").bufdelete" mappings.closeCurrent.description)
|
(
|
||||||
|
mkLuaBinding cfg.mappings.closeCurrent "require(\"bufdelete\").bufdelete"
|
||||||
|
mappings.closeCurrent.description
|
||||||
|
)
|
||||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||||
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
(mkBinding cfg.mappings.cycleNext ":BufferLineCycleNext<CR>" mappings.cycleNext.description)
|
||||||
(mkBinding cfg.mappings.cyclePrevious ":BufferLineCyclePrev<CR>" mappings.cyclePrevious.description)
|
(mkBinding cfg.mappings.cyclePrevious ":BufferLineCyclePrev<CR>" mappings.cyclePrevious.description)
|
||||||
(mkBinding cfg.mappings.pick ":BufferLinePick<CR>" mappings.pick.description)
|
(mkBinding cfg.mappings.pick ":BufferLinePick<CR>" mappings.pick.description)
|
||||||
(mkBinding cfg.mappings.sortByExtension ":BufferLineSortByExtension<CR>" mappings.sortByExtension.description)
|
(
|
||||||
(mkBinding cfg.mappings.sortByDirectory ":BufferLineSortByDirectory<CR>" mappings.sortByDirectory.description)
|
mkBinding cfg.mappings.sortByExtension ":BufferLineSortByExtension<CR>"
|
||||||
(mkLuaBinding cfg.mappings.sortById "function() require(\"bufferline\").sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end) end" mappings.sortById.description)
|
mappings.sortByExtension.description
|
||||||
|
)
|
||||||
|
(
|
||||||
|
mkBinding cfg.mappings.sortByDirectory ":BufferLineSortByDirectory<CR>"
|
||||||
|
mappings.sortByDirectory.description
|
||||||
|
)
|
||||||
|
(
|
||||||
|
mkLuaBinding cfg.mappings.sortById
|
||||||
|
"function() require(\"bufferline\").sort_buffers_by(function (buf_a, buf_b) return buf_a.id < buf_b.id end) end"
|
||||||
|
mappings.sortById.description
|
||||||
|
)
|
||||||
(mkBinding cfg.mappings.moveNext ":BufferLineMoveNext<CR>" mappings.moveNext.description)
|
(mkBinding cfg.mappings.moveNext ":BufferLineMoveNext<CR>" mappings.moveNext.description)
|
||||||
(mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev<CR>" mappings.movePrevious.description)
|
(mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev<CR>" mappings.movePrevious.description)
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,20 @@ in {
|
||||||
vim = {
|
vim = {
|
||||||
lazy.plugins.toggleterm-nvim = {
|
lazy.plugins.toggleterm-nvim = {
|
||||||
package = "toggleterm-nvim";
|
package = "toggleterm-nvim";
|
||||||
cmd = ["ToggleTerm" "ToggleTermSendCurrentLine" "ToggleTermSendVisualLines" "ToggleTermSendVisualSelection" "ToggleTermSetName" "ToggleTermToggleAll"];
|
cmd = [
|
||||||
|
"ToggleTerm"
|
||||||
|
"ToggleTermSendCurrentLine"
|
||||||
|
"ToggleTermSendVisualLines"
|
||||||
|
"ToggleTermSendVisualSelection"
|
||||||
|
"ToggleTermSetName"
|
||||||
|
"ToggleTermToggleAll"
|
||||||
|
];
|
||||||
keys =
|
keys =
|
||||||
[(mkKeymap "n" cfg.mappings.open "<Cmd>execute v:count . \"ToggleTerm\"<CR>" {desc = "Toggle terminal";})]
|
[
|
||||||
|
(mkKeymap ["n" "t"] cfg.mappings.open "<Cmd>execute v:count . \"ToggleTerm\"<CR>" {
|
||||||
|
desc = "Toggle terminal";
|
||||||
|
})
|
||||||
|
]
|
||||||
++ optional cfg.lazygit.enable {
|
++ optional cfg.lazygit.enable {
|
||||||
key = cfg.lazygit.mappings.open;
|
key = cfg.lazygit.mappings.open;
|
||||||
mode = "n";
|
mode = "n";
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ in {
|
||||||
'');
|
'');
|
||||||
|
|
||||||
pluginRC.treesitter = entryAfter ["basic"] ''
|
pluginRC.treesitter = entryAfter ["basic"] ''
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.config').setup {
|
||||||
-- Disable imperative treesitter options that would attempt to fetch
|
-- Disable imperative treesitter options that would attempt to fetch
|
||||||
-- grammars into the read-only Nix store. To add additional grammars here
|
-- grammars into the read-only Nix store. To add additional grammars here
|
||||||
-- you must use the `config.vim.treesitter.grammars` option.
|
-- you must use the `config.vim.treesitter.grammars` option.
|
||||||
|
|
|
||||||
|
|
@ -25,14 +25,14 @@ in {
|
||||||
type = listOf package;
|
type = listOf package;
|
||||||
default = [];
|
default = [];
|
||||||
example = literalExpression ''
|
example = literalExpression ''
|
||||||
with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [
|
||||||
regex
|
regex
|
||||||
kdl
|
kdl
|
||||||
];
|
];
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
List of treesitter grammars to install. For grammars to be installed properly,
|
List of treesitter grammars to install. For grammars to be installed properly,
|
||||||
you must use grammars from `pkgs.vimPlugins.nvim-treesitter.builtGrammars`.
|
you must use grammars from `pkgs.vimPlugins.nvim-treesitter.grammarPlugins`.
|
||||||
You can use `pkgs.vimPlugins.nvim-treesitter.allGrammars` to install all grammars.
|
You can use `pkgs.vimPlugins.nvim-treesitter.allGrammars` to install all grammars.
|
||||||
|
|
||||||
For languages already supported by nvf, you may use
|
For languages already supported by nvf, you may use
|
||||||
|
|
@ -56,7 +56,7 @@ in {
|
||||||
internal = true;
|
internal = true;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
type = listOf package;
|
type = listOf package;
|
||||||
default = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [c lua vim vimdoc query];
|
default = with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [c lua vim vimdoc query];
|
||||||
description = ''
|
description = ''
|
||||||
A list of treesitter grammars that will be installed by default
|
A list of treesitter grammars that will be installed by default
|
||||||
if treesitter has been enabled and {option}`vim.treeesitter.addDefaultGrammars`
|
if treesitter has been enabled and {option}`vim.treeesitter.addDefaultGrammars`
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ in {
|
||||||
|
|
||||||
# set up treesitter-textobjects after Treesitter, whose config we're adding to.
|
# set up treesitter-textobjects after Treesitter, whose config we're adding to.
|
||||||
pluginRC.treesitter-textobjects = entryAfter ["treesitter"] ''
|
pluginRC.treesitter-textobjects = entryAfter ["treesitter"] ''
|
||||||
require("nvim-treesitter.configs").setup({textobjects = ${toLuaObject cfg.setupOpts}})
|
require("nvim-treesitter.config").setup({textobjects = ${toLuaObject cfg.setupOpts}})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
cfg = config.vim.ui.noice;
|
cfg = config.vim.ui.noice;
|
||||||
tscfg = config.vim.treesitter;
|
tscfg = config.vim.treesitter;
|
||||||
|
|
||||||
defaultGrammars = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [vim regex lua bash markdown];
|
defaultGrammars = with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [vim regex lua bash markdown];
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,148 @@
|
||||||
{lib, ...}: let
|
{lib, ...}: let
|
||||||
inherit (lib.options) mkEnableOption;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
|
inherit (lib.types) anything attrsOf listOf enum;
|
||||||
inherit (lib.nvim.binds) mkMappingOption;
|
inherit (lib.nvim.binds) mkMappingOption;
|
||||||
|
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
||||||
|
inherit (lib.generators) mkLuaInline;
|
||||||
in {
|
in {
|
||||||
options.vim.utility.ccc = {
|
options.vim.utility.ccc = {
|
||||||
enable = mkEnableOption "ccc color picker for neovim";
|
enable = mkEnableOption "ccc color picker for neovim";
|
||||||
|
|
||||||
|
setupOpts = mkPluginSetupOption "ccc.nvim" {
|
||||||
|
highlighter = mkOption {
|
||||||
|
type = attrsOf anything;
|
||||||
|
default = {
|
||||||
|
auto_enable = true;
|
||||||
|
max_byte = 2 * 1024 * 1024; # 2mb
|
||||||
|
lsp = true;
|
||||||
|
filetypes = mkLuaInline "colorPickerFts";
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
Settings for the highlighter. See {command}`:help ccc` for options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
pickers = mkOption {
|
||||||
|
type = listOf luaInline;
|
||||||
|
default = map mkLuaInline [
|
||||||
|
"ccc.picker.hex"
|
||||||
|
"ccc.picker.css_rgb"
|
||||||
|
"ccc.picker.css_hsl"
|
||||||
|
"ccc.picker.ansi_escape { meaning1 = \"bold\", }"
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
List of formats that can be detected by {command}`:CccPick` to be
|
||||||
|
activated.
|
||||||
|
|
||||||
|
Must be inline lua references to `ccc.picker`, for example
|
||||||
|
`mkLuaInline "ccc.picker.hex"`. See {command}`:help ccc` for options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
alpha_show = mkOption {
|
||||||
|
type = enum [
|
||||||
|
"show"
|
||||||
|
"hide"
|
||||||
|
"auto"
|
||||||
|
];
|
||||||
|
default = "hide";
|
||||||
|
description = ''
|
||||||
|
This option determines whether the alpha slider is displayed when the
|
||||||
|
UI is opened. "show" and "hide" mean as they are. "auto" makes the
|
||||||
|
slider appear only when the alpha value can be picked up.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
recognize = mkOption {
|
||||||
|
type = attrsOf anything;
|
||||||
|
default = {
|
||||||
|
output = true;
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
Settings for recognizing the color format. See {command}`:help ccc` for options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
inputs = mkOption {
|
||||||
|
type = listOf luaInline;
|
||||||
|
default = map mkLuaInline ["ccc.input.hsl"];
|
||||||
|
description = ''
|
||||||
|
List of color systems to be activated. Must be inline lua references to
|
||||||
|
`ccc.input`, for example `mkLuaInline "ccc.input.rgb"`. See
|
||||||
|
{command}`:help ccc` for options.
|
||||||
|
|
||||||
|
The toggle input mode action toggles in this order. The first one is
|
||||||
|
the default used at the first startup. Once activated, it will keep the
|
||||||
|
previous input mode.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = mkOption {
|
||||||
|
type = listOf luaInline;
|
||||||
|
default = map mkLuaInline [
|
||||||
|
"ccc.output.css_hsl"
|
||||||
|
"ccc.output.css_rgb"
|
||||||
|
"ccc.output.hex"
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
List of output formats to be activated. Must be inline Lua references to
|
||||||
|
`ccc.output`, for example `mkLuaInline "ccc.output.rgb"`. See
|
||||||
|
{command}`:help ccc` for options.
|
||||||
|
|
||||||
|
The toggle output mode action toggles in this order. The first one is
|
||||||
|
the default used at the first startup. Once activated, it will keep the
|
||||||
|
previous output mode.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
convert = mkOption {
|
||||||
|
type = listOf (listOf luaInline);
|
||||||
|
default = map (map mkLuaInline) [
|
||||||
|
[
|
||||||
|
"ccc.picker.hex"
|
||||||
|
"ccc.output.css_hsl"
|
||||||
|
]
|
||||||
|
[
|
||||||
|
"ccc.picker.css_rgb"
|
||||||
|
"ccc.output.css_hsl"
|
||||||
|
]
|
||||||
|
[
|
||||||
|
"ccc.picker.css_hsl"
|
||||||
|
"ccc.output.hex"
|
||||||
|
]
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
Specify the correspondence between picker and output. Must be a list of
|
||||||
|
two-element lists defining picker/output pairs as inline Lua references,
|
||||||
|
for example:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
map (map mkLuaInline) [
|
||||||
|
["ccc.picker.hex", "ccc.output.css_rgb"]
|
||||||
|
["ccc.picker.css_rgb", "ccc.output.hex"]
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
See {command}`:help ccc` for options.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
mappings = mkOption {
|
||||||
|
type = attrsOf luaInline;
|
||||||
|
default = {
|
||||||
|
"q" = mkLuaInline "ccc.mapping.quit";
|
||||||
|
"L" = mkLuaInline "ccc.mapping.increase10";
|
||||||
|
"H" = mkLuaInline "ccc.mapping.decrease10";
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
The mappings are set in the UI of ccc. The table where lhs is key and
|
||||||
|
rhs is value. To disable all default mappings, use
|
||||||
|
{option}`vim.utility.ccc.setupOpts.disable_default_mappings`. To
|
||||||
|
disable only some of the default mappings, set `ccc.mapping.none`.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
mappings = {
|
mappings = {
|
||||||
quit = mkMappingOption "Cancel and close the UI without replace or insert" "<Esc>";
|
quit = mkMappingOption "Cancel and close the UI without replace or insert" "<Esc>";
|
||||||
increase10 = mkMappingOption "Increase the value times delta of the slider" "<L>";
|
increase10 = mkMappingOption "Increase the value times delta of the slider" "<L>";
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
cfg = config.vim.utility.ccc;
|
cfg = config.vim.utility.ccc;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
@ -13,40 +13,7 @@ in {
|
||||||
|
|
||||||
vim.pluginRC.ccc = entryAnywhere ''
|
vim.pluginRC.ccc = entryAnywhere ''
|
||||||
local ccc = require("ccc")
|
local ccc = require("ccc")
|
||||||
ccc.setup {
|
ccc.setup(${toLuaObject cfg.setupOpts})
|
||||||
highlighter = {
|
|
||||||
auto_enable = true,
|
|
||||||
max_byte = 2 * 1024 * 1024, -- 2mb
|
|
||||||
lsp = true,
|
|
||||||
filetypes = colorPickerFts,
|
|
||||||
},
|
|
||||||
pickers = {
|
|
||||||
ccc.picker.hex,
|
|
||||||
ccc.picker.css_rgb,
|
|
||||||
ccc.picker.css_hsl,
|
|
||||||
ccc.picker.ansi_escape {
|
|
||||||
meaning1 = "bright", -- whether the 1 means bright or yellow
|
|
||||||
},
|
|
||||||
},
|
|
||||||
alpha_show = "hide", -- needed when highlighter.lsp is set to true
|
|
||||||
recognize = { output = true }, -- automatically recognize color format under cursor
|
|
||||||
inputs = { ccc.input.hsl },
|
|
||||||
outputs = {
|
|
||||||
ccc.output.css_hsl,
|
|
||||||
ccc.output.css_rgb,
|
|
||||||
ccc.output.hex,
|
|
||||||
},
|
|
||||||
convert = {
|
|
||||||
{ ccc.picker.hex, ccc.output.css_hsl },
|
|
||||||
{ ccc.picker.css_rgb, ccc.output.css_hsl },
|
|
||||||
{ ccc.picker.css_hsl, ccc.output.hex },
|
|
||||||
},
|
|
||||||
mappings = {
|
|
||||||
["q"] = ccc.mapping.quit,
|
|
||||||
["L"] = ccc.mapping.increase10,
|
|
||||||
["H"] = ccc.mapping.decrease10,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -285,9 +285,9 @@
|
||||||
},
|
},
|
||||||
"branch": "main",
|
"branch": "main",
|
||||||
"submodules": false,
|
"submodules": false,
|
||||||
"revision": "38db66c4e20032821bd166f7012291fe99f1e8f3",
|
"revision": "b3bb0d73079643d4a5b0d8b621cde619a73bc91a",
|
||||||
"url": "https://github.com/olimorris/codecompanion.nvim/archive/38db66c4e20032821bd166f7012291fe99f1e8f3.tar.gz",
|
"url": "https://github.com/olimorris/codecompanion.nvim/archive/b3bb0d73079643d4a5b0d8b621cde619a73bc91a.tar.gz",
|
||||||
"hash": "1iqqgcj7vdsif0fj0pf6ifn3nh05aznk2gnas7l3lg8b5g103vb8"
|
"hash": "0jzldi9h98hci5ij1qnb4283hmh14irnprp5zg6mnfs9l6m8z3mq"
|
||||||
},
|
},
|
||||||
"codewindow-nvim": {
|
"codewindow-nvim": {
|
||||||
"type": "Git",
|
"type": "Git",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue