2023-02-28 07:13:56 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-07 00:50:27 +00:00
|
|
|
}: let
|
|
|
|
inherit (lib) mkIf nvim;
|
|
|
|
|
2023-02-28 07:13:56 +00:00
|
|
|
cfg = config.vim.binds.whichKey;
|
|
|
|
in {
|
|
|
|
config = mkIf (cfg.enable) {
|
|
|
|
vim.startPlugins = ["which-key"];
|
|
|
|
|
|
|
|
vim.luaConfigRC.whichkey = nvim.dag.entryAnywhere ''
|
2023-04-02 19:54:19 +00:00
|
|
|
local wk = require("which-key")
|
|
|
|
wk.setup ({
|
|
|
|
key_labels = {
|
|
|
|
["<space>"] = "SPACE",
|
|
|
|
["<leader>"] = "SPACE",
|
|
|
|
["<cr>"] = "RETURN",
|
|
|
|
["<tab>"] = "TAB",
|
2023-07-26 07:27:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
${lib.optionalString (config.vim.ui.borders.plugins.which-key.enable) ''
|
|
|
|
window = {
|
|
|
|
border = "${config.vim.ui.borders.plugins.which-key.style}",
|
|
|
|
},
|
|
|
|
''}
|
2023-04-02 19:54:19 +00:00
|
|
|
})
|
2023-02-28 07:13:56 +00:00
|
|
|
|
2023-04-02 19:54:19 +00:00
|
|
|
wk.register({
|
|
|
|
${
|
2023-02-28 07:13:56 +00:00
|
|
|
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 ""
|
|
|
|
}
|
|
|
|
|
2023-04-02 19:54:19 +00:00
|
|
|
${
|
2023-02-28 07:13:56 +00:00
|
|
|
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 ""
|
|
|
|
}
|
|
|
|
|
2023-04-02 19:54:19 +00:00
|
|
|
${
|
2023-02-28 07:13:56 +00:00
|
|
|
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 ""
|
|
|
|
}
|
|
|
|
|
2023-04-02 19:54:19 +00:00
|
|
|
${
|
2023-02-28 07:13:56 +00:00
|
|
|
if config.vim.lsp.nvimCodeActionMenu.enable
|
|
|
|
then ''
|
|
|
|
-- Parent Groups
|
|
|
|
["<leader>c"] = { name = "+CodeAction" },
|
|
|
|
''
|
|
|
|
else ""
|
|
|
|
}
|
|
|
|
|
2023-04-02 19:54:19 +00:00
|
|
|
${
|
2023-02-28 07:13:56 +00:00
|
|
|
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 ""
|
|
|
|
}
|
|
|
|
|
2023-04-02 19:54:19 +00:00
|
|
|
${
|
2023-02-28 07:13:56 +00:00
|
|
|
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 ""
|
|
|
|
}
|
|
|
|
|
2023-04-02 19:54:19 +00:00
|
|
|
${
|
2023-04-12 15:17:23 +00:00
|
|
|
# TODO: This probably will need to be reworked for custom-keybinds
|
2023-07-30 08:41:09 +00:00
|
|
|
if config.vim.filetree.nvimTree.enable
|
2023-02-28 07:13:56 +00:00
|
|
|
then ''
|
|
|
|
-- NvimTree
|
|
|
|
["<leader>t"] = { name = "+NvimTree" },
|
|
|
|
''
|
|
|
|
else ""
|
|
|
|
}
|
|
|
|
|
2023-04-02 19:54:19 +00:00
|
|
|
${
|
2023-02-28 07:13:56 +00:00
|
|
|
if config.vim.git.gitsigns.enable
|
|
|
|
then ''
|
|
|
|
-- Git
|
|
|
|
["<leader>g"] = { name = "+Gitsigns" },
|
|
|
|
''
|
|
|
|
else ""
|
|
|
|
}
|
2023-04-02 19:54:19 +00:00
|
|
|
|
|
|
|
${
|
2023-04-17 21:38:57 +00:00
|
|
|
if config.vim.languages.markdown.glow.enable
|
2023-03-01 11:00:26 +00:00
|
|
|
then ''
|
|
|
|
-- Markdown
|
|
|
|
["<leader>pm"] = { name = "+Preview Markdown" },
|
|
|
|
''
|
|
|
|
else ""
|
|
|
|
}
|
2023-04-02 19:54:19 +00:00
|
|
|
|
2023-03-01 11:00:26 +00:00
|
|
|
})
|
2023-02-28 07:13:56 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|