mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 09:49:48 +01:00
binds/which-key: changing to the new spec (#448)
This commit is contained in:
parent
516174e296
commit
c6ff6bbca6
2 changed files with 5 additions and 1 deletions
|
@ -309,6 +309,7 @@ To migrate to `nixfmt`, simply change `vim.languages.nix.format.type` to
|
||||||
- Add [Tinymist](https://github.com/Myriad-Dreamin/tinymist] as a formatter for
|
- Add [Tinymist](https://github.com/Myriad-Dreamin/tinymist] as a formatter for
|
||||||
the Typst language module.
|
the Typst language module.
|
||||||
- Add LSP and Treesitter support for Assembly under `vim.languages.assembly`
|
- Add LSP and Treesitter support for Assembly under `vim.languages.assembly`
|
||||||
|
- Move [which-key](https://github.com/folke/which-key.nvim) to the new spec
|
||||||
|
|
||||||
[Bloxx12](https://github.com/Bloxx12)
|
[Bloxx12](https://github.com/Bloxx12)
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,12 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.dag) entryAnywhere;
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
|
||||||
cfg = config.vim.binds.whichKey;
|
cfg = config.vim.binds.whichKey;
|
||||||
|
register = mapAttrsToList (n: v: mkLuaInline "{ '${n}', desc = '${v}' }") cfg.register;
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
|
@ -16,7 +19,7 @@ in {
|
||||||
pluginRC.whichkey = entryAnywhere ''
|
pluginRC.whichkey = entryAnywhere ''
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
wk.setup (${toLuaObject cfg.setupOpts})
|
wk.setup (${toLuaObject cfg.setupOpts})
|
||||||
wk.register(${toLuaObject cfg.register})
|
wk.add(${toLuaObject register})
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue