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

View file

@ -4,7 +4,7 @@
... ...
}: let }: let
inherit (builtins) toJSON; inherit (builtins) toJSON;
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetExprBinding mkSetLuaBinding nvim; inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetExprBinding mkSetLuaBinding nvim defaultAttributes;
cfg = config.vim.git; 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") (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 '' vim.luaConfigRC.gitsigns = nvim.dag.entryAnywhere ''
require('gitsigns').setup{} require('gitsigns').setup{}
''; '';

View file

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

View file

@ -3,7 +3,7 @@
lib, lib,
... ...
}: let }: let
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim; inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim defaultAttributes;
cfg = config.vim.lsp; cfg = config.vim.lsp;
@ -24,6 +24,12 @@ in {
(mkSetBinding mappings.locList "<cmd>TroubleToggle loclist<CR>") (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 '' vim.luaConfigRC.trouble = nvim.dag.entryAnywhere ''
-- Enable trouble diagnostics viewer -- Enable trouble diagnostics viewer
require("trouble").setup {} require("trouble").setup {}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@
lib, lib,
... ...
}: let }: let
inherit (lib) mkIf mkMerge mkLuaBinding mkBinding nvim; inherit (lib) mkIf mkMerge mkLuaBinding mkBinding nvim defaultAttributes;
cfg = config.vim.tabline.nvimBufferline; cfg = config.vim.tabline.nvimBufferline;
self = import ./nvim-bufferline.nix { self = import ./nvim-bufferline.nix {
@ -40,6 +40,13 @@ in {
(mkBinding cfg.mappings.movePrevious ":BufferLineMovePrev<CR>" mappings.movePrevious.description) (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 '' vim.luaConfigRC.nvimBufferline = nvim.dag.entryAnywhere ''
require("bufferline").setup{ require("bufferline").setup{
options = { options = {

View file

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

View file

@ -4,7 +4,7 @@
lib, lib,
... ...
}: let }: let
inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim; inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim defaultAttributes;
cfg = config.vim.telescope; cfg = config.vim.telescope;
self = import ./telescope.nix {inherit lib;}; 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 '' vim.luaConfigRC.telescope = nvim.dag.entryAnywhere ''
local telescope = require('telescope') local telescope = require('telescope')
telescope.setup { telescope.setup {