nvf/modules/utility/binds/which-key/config.nix
NotAShelf 729276c4c5
feat: apply new module format to utility plugins
new file:   modules/utility/binds/cheatsheet/cheatsheet.nix
	new file:   modules/utility/binds/cheatsheet/config.nix
	modified:   modules/utility/binds/cheatsheet/default.nix
	modified:   modules/utility/binds/default.nix
	new file:   modules/utility/binds/which-key/config.nix
	modified:   modules/utility/binds/which-key/default.nix
	new file:   modules/utility/binds/which-key/which-key.nix
	renamed:    modules/utility/colorizer.nix -> modules/utility/colorizer/colorizer.nix
	new file:   modules/utility/colorizer/config.nix
	new file:   modules/utility/colorizer/default.nix
	modified:   modules/utility/default.nix
	modified:   modules/utility/gestures/default.nix
	renamed:    modules/utility/gestures/gesture-nvim.nix -> modules/utility/gestures/gesture-nvim/config.nix
	new file:   modules/utility/gestures/gesture-nvim/default.nix
	new file:   modules/utility/gestures/gesture-nvim/gesture-nvim.nix
	renamed:    modules/utility/icon-picker.nix -> modules/utility/icon-picker/config.nix
	new file:   modules/utility/icon-picker/default.nix
	new file:   modules/utility/icon-picker/icon-picker.nix
	new file:   modules/utility/telescope/config.nix
	modified:   modules/utility/telescope/default.nix
	new file:   modules/utility/telescope/telescope.nix
	renamed:    modules/utility/venn.nix -> modules/utility/venn/config.nix
	new file:   modules/utility/venn/default.nix
	new file:   modules/utility/venn/venn.nix
2023-02-28 10:14:44 +03:00

116 lines
2.8 KiB
Nix

{
pkgs,
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.binds.whichKey;
in {
config = mkIf (cfg.enable) {
vim.startPlugins = ["which-key"];
vim.luaConfigRC.whichkey = nvim.dag.entryAnywhere ''
local wk = require("which-key")
wk.setup {}
wk.register({
key_labels = {
["<space>"] = "SPACE",
["<leader>"] = "SPACE",
["<cr>"] = "RETURN",
["<tab>"] = "TAB",
},
${
if config.vim.tabline.nvimBufferline.enable
then ''
-- Buffer
["<leader>b"] = { name = "+Buffer" },
["<leader>bm"] = { name = "BufferLineMove" },
["<leader>bs"] = { name = "BufferLineSort" },
["<leader>bsi"] = { name = "BufferLineSortById" },
''
else ""
}
${
if config.vim.telescope.enable
then ''
["<leader>f"] = { name = "+Telescope" },
-- 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" },
''
else ""
}
${
if config.vim.lsp.trouble.enable
then ''
-- Trouble
["<leader>lw"] = { name = "Workspace" },
["<leader>x"] = { name = "+Trouble" }, -- TODO: move all trouble binds to the same parent group
["<leader>l"] = { name = "+Trouble" },
''
else ""
}
${
if config.vim.lsp.nvimCodeActionMenu.enable
then ''
-- Parent Groups
["<leader>c"] = { name = "+CodeAction" },
''
else ""
}
${
if config.vim.minimap.codewindow.enable || config.vim.minimap.minimap-vim.enable
then ''
-- Minimap
["<leader>m"] = { name = "+Minimap" }, -- TODO: remap both minimap plugins' keys to be the same
''
else ""
}
${
if config.vim.notes.mind-nvim.enable || config.vim.notes.obsidian.enable || config.vim.notes.orgmode.enable
then ''
-- Notes
["<leader>o"] = { name = "+Notes" },
-- TODO: options for other note taking plugins and their individual binds
-- TODO: move all note-taker binds under leader + o
''
else ""
}
${
if config.vim.filetree.nvimTreeLua.enable
then ''
-- NvimTree
["<leader>t"] = { name = "+NvimTree" },
''
else ""
}
${
if config.vim.git.gitsigns.enable
then ''
-- Git
["<leader>g"] = { name = "+Gitsigns" },
''
else ""
}
})
'';
};
}