mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
feat: conditionally write which-key registers
This commit is contained in:
parent
4354cabc39
commit
b4027c4bba
4 changed files with 111 additions and 51 deletions
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.binds.cheatsheet;
|
||||
in {
|
||||
options.vim.binds.cheatsheet = {
|
||||
enable = mkEnableOption "Searchable cheatsheet for nvim using telescope";
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
vim.startPlugins = ["cheatsheet-nvim"];
|
||||
|
||||
vim.luaConfigRC.cheaetsheet-nvim = nvim.dag.entryAnywhere ''
|
||||
require('cheatsheet').setup({})
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./which-key.nix
|
||||
./cheatsheet.nix
|
||||
];
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with builtins; let
|
||||
cfg = config.vim.binds.whichKey;
|
||||
in {
|
||||
options.vim.binds.whichKey = {
|
||||
enable = mkEnableOption "which-key menu";
|
||||
};
|
||||
|
||||
config = mkIf (cfg.enable) {
|
||||
vim.startPlugins = ["which-key"];
|
||||
|
||||
vim.luaConfigRC.whichkey = nvim.dag.entryAnywhere ''
|
||||
require("which-key").setup {}
|
||||
|
||||
local wk = require("which-key")
|
||||
wk.register({
|
||||
["<leader>b"] = { name = "+Buffer" },
|
||||
["<leader>c"] = { name = "+CodeAction" },
|
||||
["<leader>b"] = { name = "+Buffer" },
|
||||
["<leader>f"] = { name = "+Telescope" },
|
||||
["<leader>m"] = { name = "+Minimap" },
|
||||
["<leader>o"] = { name = "+Notes" },
|
||||
["<leader>t"] = { name = "+NvimTree" },
|
||||
["<leader>x"] = { name = "+Trouble" }, -- TODO: move all trouble binds to the same parent group
|
||||
["<leader>l"] = { name = "+Trouble" },
|
||||
|
||||
-- Buffer
|
||||
["<leader>bm"] = { name = "BufferLineMove" },
|
||||
["<leader>bm"] = { name = "BufferLineSort" },
|
||||
|
||||
-- Telescope
|
||||
["<leader>fl"] = { name = "Telescope LSP" },
|
||||
["<leader>fm"] = { name = "Cellular Automaton" }, -- TODO: mvoe this to its own parent group
|
||||
["<leader>fv"] = { name = "Telescope Git" },
|
||||
["<leader>fvc"] = { name = "Commits" },
|
||||
|
||||
-- Trouble
|
||||
["<leader>lw"] = { name = "Workspace" },
|
||||
})
|
||||
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue