diff --git a/nvim/.config/nvim/lua/maps.lua b/nvim/.config/nvim/lua/maps.lua index ee74a10..171fee2 100644 --- a/nvim/.config/nvim/lua/maps.lua +++ b/nvim/.config/nvim/lua/maps.lua @@ -1,4 +1,5 @@ local map = vim.keymap.set +local prefix = require('which-key').register -- The general ideas behind these mappings: -- @@ -120,6 +121,7 @@ map('n', 'e', ':Vifm', { desc = 'browse files' }) map('n', 'E', ':Vifm getcwd()', { desc = 'browse project' }) -- set 'v'im-related options +prefix({ ['v'] = { name = "+vim" } }) map('n', 'vc', ':Vifm ' .. vim.fn.stdpath('config') .. '/lua', { desc = 'open config' }) map('n', 'vh', ":lua require 'telescope.builtin'.help_tags()", @@ -137,6 +139,7 @@ map('n', 'vz', ':ZenMode', { silent = true }) -- PLUGIN: Telescope GLOBAL FUZZY FINDING -- buffers and files in current workdir +prefix({ ['f'] = { name = '+find' } }) map('n', 'fb', ":lua require 'telescope.builtin'.buffers(require 'telescope.themes'.get_ivy())", { desc = 'list buffers' }) @@ -188,6 +191,7 @@ map('n', 'F', ':FormatWriteLock') -- SPELL CHECKING -- Move to the prev/next spelling error with [S ]S -- Move to the prev/next spelling error or suggestion with [s ]s +prefix({ ['Z'] = { name = '+Spelling' } }) map('n', 'ZZ', ':setlocal spell! spelllang=en_us,de_de', { desc = 'Toggle spellcheck' }) map('n', 'ZE', ':setlocal spell! spelllang=en_us', @@ -199,18 +203,21 @@ map('i', '', 'u[s1z=`]au') map('n', 's', 'ms[s1z=`s', { desc = 'Fix last spell error' }) -- PLUGIN: mini.nvim -map('n', 'sm', ':lua MiniMap.toggle()', { silent = true, desc = 'toggle minimap' }) +prefix({ ['s'] = { name = '+show' } }) +map('n', 'sm', ':lua MiniMap.toggle()', + { silent = true, desc = 'toggle minimap' }) map('n', 'ss', ":lua MiniStarter.open()", { desc = 'show startpage' }) +-- PLUGIN: symbols-outline.nvim +map('n', 'so', 'SymbolsOutline', + { silent = true, desc = 'toggle symbol outline' }) + -- PLUGIN: easy-align -- Start interactive EasyAlign in visual mode (e.g. vipga) map('x', 'ga', '(EasyAlign)') -- Start interactive EasyAlign for a motion/text object (e.g. gaip) map('n', 'ga', '(EasyAlign)') --- PLUGIN: symbols-outline.nvim -map('n', 'so', 'SymbolsOutline', { silent = true, desc = 'toggle symbol outline' }) - -- trim trailing whitespaces with mini.nvim trailspace map("n", "w", function() require("mini.trailspace").trim() end, { noremap = true }) @@ -226,7 +233,9 @@ map("v", "g", 'g(dial-increment)') -- PLUGIN: zettelkasten.nvim map('n', '', [[:silent lua require 'zettelkasten'.link_follow()]]) map('v', '', [[:lua require 'zettelkasten'.link_follow(true)]]) -map('n', 'ww', [[:lua require 'zettelkasten'.index_open() ]]) +prefix({ ['w'] = { name = '+wiki' } }) +map('n', 'ww', [[:lua require 'zettelkasten'.index_open() ]], + { desc = "open wiki" }) -- PLUGIN: toggleterm.nvim -- create a lazygit window, set up in toggleterm settings