treewide: register whichKey labels

This commit is contained in:
Frothy 2024-02-25 11:39:05 -05:00
parent f19a5dd3ed
commit b9aa7088b8
12 changed files with 69 additions and 12 deletions

View file

@ -4,7 +4,7 @@
pkgs,
...
}: let
inherit (lib) mkIf mkMerge mkBinding nvim boolToString;
inherit (lib) mkIf mkMerge mkBinding nvim boolToString defaultAttributes;
cfg = config.vim.filetree.nvimTree;
self = import ./nvimtree.nix {
@ -23,6 +23,10 @@ in {
(mkBinding cfg.mappings.focus ":NvimTreeFocus<cr>" mappings.focus.description)
];
vim.binds.whichKey.register = defaultAttributes {
"<leader>t" = "+NvimTree";
};
vim.luaConfigRC.nvimtreelua = nvim.dag.entryAnywhere ''
${
lib.optionalString (cfg.disableNetrw) ''

View file

@ -4,7 +4,7 @@
...
}: let
inherit (builtins) toJSON;
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetExprBinding mkSetLuaBinding nvim;
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetExprBinding mkSetLuaBinding nvim defaultAttributes;
cfg = config.vim.git;
@ -61,6 +61,10 @@ in {
(mkSetLuaBinding gsMappings.resetHunk "function() package.loaded.gitsigns.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end")
];
vim.binds.whichKey.register = defaultAttributes {
"<leader>g" = "+Gitsigns";
};
vim.luaConfigRC.gitsigns = nvim.dag.entryAnywhere ''
require('gitsigns').setup{}
'';

View file

@ -3,7 +3,7 @@
lib,
...
}: let
inherit (lib) addDescriptionsToMappings mkIf mkSetBinding nvim;
inherit (lib) addDescriptionsToMappings mkIf mkSetBinding nvim defaultAttributes;
cfg = config.vim.lsp;
@ -17,6 +17,10 @@ in {
vim.maps.normal = mkSetBinding mappings.open ":CodeActionMenu<CR>";
vim.binds.whichKey.register = defaultAttributes {
"<leader>c" = "+CodeAction";
};
vim.luaConfigRC.code-action-menu = nvim.dag.entryAnywhere ''
-- border configuration
vim.g.code_action_menu_window_border = '${config.vim.ui.borders.plugins.code-action-menu.style}'

View file

@ -3,7 +3,7 @@
lib,
...
}: let
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim;
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim defaultAttributes;
cfg = config.vim.lsp;
@ -24,6 +24,12 @@ in {
(mkSetBinding mappings.locList "<cmd>TroubleToggle loclist<CR>")
];
vim.binds.whichKey.register = defaultAttributes {
"<leader>l" = "Trouble";
"<leader>x" = "+Trouble";
"<leader>lw" = "Workspace";
};
vim.luaConfigRC.trouble = nvim.dag.entryAnywhere ''
-- Enable trouble diagnostics viewer
require("trouble").setup {}

View file

@ -3,7 +3,7 @@
lib,
...
}: let
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetLuaBinding nvim;
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetLuaBinding nvim defaultAttributes;
cfg = config.vim.minimap.codewindow;
@ -24,6 +24,10 @@ in {
(mkSetLuaBinding mappings.toggleFocus "require('codewindow').toggle_focus")
];
vim.binds.whichKey.register = defaultAttributes {
"<leader>m" = "+Minimap";
};
vim.luaConfigRC.codewindow = nvim.dag.entryAnywhere ''
local codewindow = require('codewindow')
codewindow.setup({

View file

@ -4,7 +4,7 @@
lib,
...
}: let
inherit (lib) mkIf;
inherit (lib) mkIf defaultAttributes;
cfg = config.vim.minimap.minimap-vim;
in {
@ -13,5 +13,9 @@ in {
pkgs.code-minimap
"minimap-vim"
];
vim.binds.whichKey.register = defaultAttributes {
"<leader>m" = "+Minimap";
};
};
}

View file

@ -3,7 +3,7 @@
lib,
...
}: let
inherit (lib) mkIf nvim;
inherit (lib) mkIf nvim defaultAttributes;
cfg = config.vim.notes.mind-nvim;
in {
@ -18,6 +18,10 @@ in {
"<leader>oc" = {action = ":MindClose<CR>";};
};
vim.binds.whichKey.register = defaultAttributes {
"<leader>o" = "+Notes";
};
vim.luaConfigRC.mind-nvim = nvim.dag.entryAnywhere ''
require'mind'.setup()
'';

View file

@ -3,7 +3,7 @@
lib,
...
}: let
inherit (lib) mkIf nvim;
inherit (lib) mkIf nvim defaultAttributes;
cfg = config.vim.notes.obsidian;
auto = config.vim.autocomplete;
@ -15,6 +15,10 @@ in {
"tabular"
];
vim.binds.whichKey.register = defaultAttributes {
"<leader>o" = "+Notes";
};
vim.luaConfigRC.obsidian = nvim.dag.entryAnywhere ''
require("obsidian").setup({
dir = "${cfg.dir}",

View file

@ -3,7 +3,7 @@
lib,
...
}: let
inherit (lib) mkIf mkMerge nvim;
inherit (lib) mkIf mkMerge nvim defaultAttributes;
cfg = config.vim.notes.orgmode;
in {
@ -13,6 +13,10 @@ in {
"orgmode-nvim"
];
vim.binds.whichKey.register = defaultAttributes {
"<leader>o" = "+Notes";
};
vim.luaConfigRC.orgmode = nvim.dag.entryAnywhere ''
-- Load custom treesitter grammar for org filetype
require('orgmode').setup_ts_grammar()

View file

@ -3,7 +3,7 @@
lib,
...
}: let
inherit (lib) mkIf mkMerge mkLuaBinding mkBinding nvim;
inherit (lib) mkIf mkMerge mkLuaBinding mkBinding nvim defaultAttributes;
cfg = config.vim.tabline.nvimBufferline;
self = import ./nvim-bufferline.nix {
@ -40,6 +40,13 @@ in {
(mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev<CR>" mappings.movePrevious.description)
];
vim.binds.whichKey.register = defaultAttributes {
"<leader>b" = "+Buffer";
"<leader>bm" = "BufferLineMove";
"<leader>bs" = "BufferLineSort";
"<leader>bsi" = "BufferLineSortById";
};
vim.luaConfigRC.nvimBufferline = nvim.dag.entryAnywhere ''
require("bufferline").setup{
options = {

View file

@ -4,7 +4,7 @@
lib,
...
}: let
inherit (lib) nvim mkIf mkMerge mkBinding;
inherit (lib) nvim mkIf mkMerge mkBinding defaultAttributes;
cfg = config.vim.utility.preview.glow;
self = import ./glow.nix {
@ -19,6 +19,10 @@ in {
(mkBinding cfg.mappings.openPreview ":Glow<CR>" mappings.openPreview.description)
];
vim.binds.whichKey.register = defaultAttributes {
"<leader>pm" = "+Preview Markdown";
};
vim.luaConfigRC.glow = nvim.dag.entryAnywhere ''
require('glow').setup({
glow_path = "${pkgs.glow}/bin/glow"

View file

@ -4,7 +4,7 @@
lib,
...
}: let
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim;
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim defaultAttributes;
cfg = config.vim.telescope;
self = import ./telescope.nix {inherit lib;};
@ -52,6 +52,14 @@ in {
)
];
vim.binds.whichKey.register = defaultAttributes {
"<leader>f" = "+Telescope";
"<leader>fl" = "Telescope LSP";
"<leader>fm" = "Cellular Automaton";
"<leader>fv" = "Telescope Git";
"<leader>fvc" = "Commits";
};
vim.luaConfigRC.telescope = nvim.dag.entryAnywhere ''
local telescope = require('telescope')
telescope.setup {