diff --git a/after/plugin/which-key.lua b/after/plugin/which-key.lua new file mode 100644 index 0000000..baea8db --- /dev/null +++ b/after/plugin/which-key.lua @@ -0,0 +1,83 @@ +local ok, wk = pcall(require,"which-key") + +if not ok then + return +end + +wk.setup{ + plugins = { + marks = true, + registers = true, + spelling = { + enabled = true, + suggestions = 10, + }, + + presets = { + operators = true, + motions = true, + text_objects = true, + windows = true, + nav = true, + z = true, + g = true, + }, + }, + icons = { + breadcrumb = "»", + separator = "", + group = " ", + }, + popup_mappings = { + scroll_down = '', + scroll_up = '', + }, + window = { + border = "single", + position = "bottom", + winblend = 0, + }, + ignore_missing = true, + show_help = true, + triggers = "auto", + +} + +wk.register( +{ + l = { + name = "lsp", + ca = {"Code Action"} + } + +}, +{prefix = ""} +) + +---@diagnostic disable-next-line: undefined-global +if packer_plugins["vimwiki"] and packer_plugins["vimwiki"].loaded then + wk.register( + { + w = { + name = "wiki", + w = {"Open wiki index"}, + t = {"Open wiki index [tab]"}, + s = {"List wikis"}, + i = {"Open diary index"}, + d = {"VimwikiMakeDiaryNote","Open diary today"}, + D = {"VimwikiTabMakeDiaryNote","Open diary today [tab]"} + } + }, + {prefix = ""} + ) +end + +---@diagnostic disable-next-line: undefined-global +if packer_plugins["zen-mode.nvim"] and packer_plugins["zen-mode.nvim"].loaded then + wk.register( + {prefix = ""}, + { + z = {"ZenMode","ZenMode"} + } + ) +end diff --git a/lua/sherlock5512/plugins.lua b/lua/sherlock5512/plugins.lua index 23227de..be450c0 100644 --- a/lua/sherlock5512/plugins.lua +++ b/lua/sherlock5512/plugins.lua @@ -35,6 +35,7 @@ return require('packer').startup(function(use) end } use "vimwiki/vimwiki" + use "folke/which-key.nvim" ------------------------- -- Editing Enhancements