nvim: update which-key syntax

This commit is contained in:
tea 2024-08-10 23:18:30 +02:00
parent 4ab9ad7fd9
commit 018a5741b7
No known key found for this signature in database
5 changed files with 11 additions and 11 deletions

View File

@ -65,7 +65,7 @@ if vim.fn.executable('lldb-vscode') > 0 then
dap.configurations.c = dap.configurations.cpp
end
require('which-key').register({ ['<Leader>d'] = { name = 'DAP' } })
require('which-key').add({{ '<Leader>d', group = 'DAP' }})
map('n', '<Leader>dc', dap.continue, 'Continue')
map('n', '<F10>', dap.step_over, 'DAP: step over')
map('n', '<F11>', dap.step_into, 'DAP: step into')

View File

@ -15,7 +15,7 @@ require('ts_context_commentstring').setup({
vim.g.skip_ts_context_commentstring_module = true; -- disable backwards compat
require('orgmode').setup {}
require('which-key').register({ ['<Leader>o'] = { name = 'Orgmode' } })
require('which-key').add({{ '<Leader>o', group = 'Orgmode' }})
local ffgroup = vim.api.nvim_create_augroup('config_ff', { clear = true })
vim.api.nvim_create_autocmd({ 'FileType' }, {

View File

@ -68,15 +68,15 @@ require('gitlinker').setup({
}
})
require('which-key').register({ ['<Leader>g'] = { name = 'Git' } })
require('which-key').register({ ['<Leader>gc'] = { name = 'commit' } })
require('which-key').add({{ '<Leader>g', group = 'Git' }})
require('which-key').add({{ '<Leader>gc', group = 'commit' }})
map('n', '<Leader>gcc', ':Git commit<CR>', 'commit')
map('n', '<Leader>gca', ':Git commit --amend<CR>', 'amend')
map('n', '<Leader>gP', ':Git push<CR>', 'push')
require('which-key').register({ ['<Leader>gp'] = { name = 'pull' } })
require('which-key').add({{ '<Leader>gp', group = 'pull' }})
map('n', '<Leader>gpo', ':Git pull origin<CR>', 'origin')
map('n', '<Leader>gpu', ':Git pull upstream<CR>', 'upstream')
require('which-key').register({ ['<Leader>ga'] = { name = 'add' } })
require('which-key').add({{ '<Leader>ga', group = 'add' }})
map('n', '<Leader>gau', ':Git add --update --patch<CR>', '--update --patch')
map('n', '<Leader>ga%', ':Git add %<CR>', 'This file')
map('n', '<Leader>gl', ':Git log --decorate<CR>', 'log')

View File

@ -13,8 +13,8 @@ local on_attach = function(client, bufnr)
map('n', 'gr', vim.lsp.buf.references, 'Show references', bufnr)
map('n', 'K', vim.lsp.buf.hover, 'Hover', bufnr)
map('i', '<C-K>', vim.lsp.buf.hover, 'Hover', bufnr)
require('which-key').register({ ['<Leader>l'] = { name = 'LSP' } })
require('which-key').register({ ['<Leader>lw'] = { name = 'workspace' } })
require('which-key').add({{ '<Leader>l', group = 'LSP' }})
require('which-key').add({{ '<Leader>lw', group = 'workspace' }})
map('n', '<Leader>lwa', vim.lsp.buf.add_workspace_folder,
'Add workspace folder', bufnr)
map('n', '<Leader>lwr', vim.lsp.buf.remove_workspace_folder,

View File

@ -29,7 +29,7 @@ telescope.setup({
local t_builtin = require('telescope.builtin')
local my = require('my.functions')
require('which-key').register({ ['<Leader>t'] = { name = 'Telescope' } })
require('which-key').add({{ '<Leader>t', group = 'Telescope' }})
map('n', '<Leader>tb', t_builtin.buffers, 'Buffers')
map('n', '<Leader>tf', function()
t_builtin.find_files({ cwd = my.get_project_root() })
@ -144,7 +144,7 @@ map('n', '<S-F9>', mind_project, 'Open project mind')
map('n', '<F21>', mind_project, 'Open project mind') -- <S-F9> = <F21>
vim.g.table_mode_map_prefix = '<Leader>T'
require('which-key').register({ ['<Leader>T'] = { name = 'Table mode' } })
require('which-key').add({{ '<Leader>T', group = 'Table mode' }})
require('dressing').setup({
input = {
@ -163,7 +163,7 @@ vim.notify = require('notify')
require('autolist').setup({})
require('which-key').register({ ['<Leader>j'] = { name = 'Jump' } })
require('which-key').add({{ '<Leader>j', group = 'Jump' }})
map('n', '<Leader>ja', require('harpoon.mark').add_file, 'Add file')
map('n', '<Leader>jm', require('harpoon.ui').toggle_quick_menu, 'Quick menu')