nvim: Add descriptions for various prefix groups

This commit is contained in:
Marty Oehme 2023-03-01 14:37:59 +01:00
parent 56003fcccb
commit e94eade3b3
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -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', '<leader>e', ':Vifm<cr>', { desc = 'browse files' })
map('n', '<leader>E', ':Vifm getcwd()<cr>', { desc = 'browse project' })
-- set 'v'im-related options
prefix({ ['<leader>v'] = { name = "+vim" } })
map('n', '<leader>vc', ':Vifm ' .. vim.fn.stdpath('config') .. '/lua<cr>',
{ desc = 'open config' })
map('n', '<leader>vh', ":lua require 'telescope.builtin'.help_tags()<cr>",
@ -137,6 +139,7 @@ map('n', '<leader>vz', ':ZenMode<cr>', { silent = true })
-- PLUGIN: Telescope GLOBAL FUZZY FINDING
-- buffers and files in current workdir
prefix({ ['<leader>f'] = { name = '+find' } })
map('n', '<leader>fb',
":lua require 'telescope.builtin'.buffers(require 'telescope.themes'.get_ivy())<cr>",
{ desc = 'list buffers' })
@ -188,6 +191,7 @@ map('n', '<localleader>F', ':FormatWriteLock<cr>')
-- 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({ ['<localleader>Z'] = { name = '+Spelling' } })
map('n', '<localleader>ZZ', ':setlocal spell! spelllang=en_us,de_de<cr>',
{ desc = 'Toggle spellcheck' })
map('n', '<localleader>ZE', ':setlocal spell! spelllang=en_us<cr>',
@ -199,18 +203,21 @@ map('i', '<c-s>', '<C-G>u<Esc>[s1z=`]a<C-G>u')
map('n', '<localleader>s', 'ms[s1z=`s', { desc = 'Fix last spell error' })
-- PLUGIN: mini.nvim
map('n', '<leader>sm', ':lua MiniMap.toggle()<cr>', { silent = true, desc = 'toggle minimap' })
prefix({ ['<leader>s'] = { name = '+show' } })
map('n', '<leader>sm', ':lua MiniMap.toggle()<cr>',
{ silent = true, desc = 'toggle minimap' })
map('n', '<leader>ss', ":lua MiniStarter.open()<cr>", { desc = 'show startpage' })
-- PLUGIN: symbols-outline.nvim
map('n', '<leader>so', '<cmd>SymbolsOutline<cr>',
{ silent = true, desc = 'toggle symbol outline' })
-- PLUGIN: easy-align
-- Start interactive EasyAlign in visual mode (e.g. vipga)
map('x', 'ga', '<Plug>(EasyAlign)')
-- Start interactive EasyAlign for a motion/text object (e.g. gaip)
map('n', 'ga', '<Plug>(EasyAlign)')
-- PLUGIN: symbols-outline.nvim
map('n', '<leader>so', '<cmd>SymbolsOutline<cr>', { silent = true, desc = 'toggle symbol outline' })
-- trim trailing whitespaces with mini.nvim trailspace
map("n", "<localleader>w", function() require("mini.trailspace").trim() end,
{ noremap = true })
@ -226,7 +233,9 @@ map("v", "g<C-x>", 'g<Plug>(dial-increment)')
-- PLUGIN: zettelkasten.nvim
map('n', '<cr>', [[:silent lua require 'zettelkasten'.link_follow()<cr>]])
map('v', '<cr>', [[:lua require 'zettelkasten'.link_follow(true)<cr>]])
map('n', '<leader>ww', [[:lua require 'zettelkasten'.index_open()<cr> ]])
prefix({ ['<leader>w'] = { name = '+wiki' } })
map('n', '<leader>ww', [[:lua require 'zettelkasten'.index_open()<cr> ]],
{ desc = "open wiki" })
-- PLUGIN: toggleterm.nvim
-- create a lazygit window, set up in toggleterm settings