ugly: fix which-keys
warnings
This commit is contained in:
parent
32371d317f
commit
0e6b7e2558
34
lua/lsp.lua
34
lua/lsp.lua
@ -43,22 +43,30 @@ local on_attach = function(_, bufnr)
|
||||
end
|
||||
|
||||
-- document existing key chains
|
||||
require('which-key').register {
|
||||
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
||||
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
||||
['<leader>g'] = { name = '[G]it', _ = 'which_key_ignore' },
|
||||
['<leader>h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' },
|
||||
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
||||
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
||||
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
|
||||
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
||||
require('which-key').add {
|
||||
{ "<leader>c", group = "[C]ode" },
|
||||
{ "<leader>c_", hidden = true },
|
||||
{ "<leader>d", group = "[D]ocument" },
|
||||
{ "<leader>d_", hidden = true },
|
||||
{ "<leader>g", group = "[G]it" },
|
||||
{ "<leader>g_", hidden = true },
|
||||
{ "<leader>h", group = "Git [H]unk" },
|
||||
{ "<leader>h_", hidden = true },
|
||||
{ "<leader>r", group = "[R]ename" },
|
||||
{ "<leader>r_", hidden = true },
|
||||
{ "<leader>s", group = "[S]earch" },
|
||||
{ "<leader>s_", hidden = true },
|
||||
{ "<leader>t", group = "[T]oggle" },
|
||||
{ "<leader>t_", hidden = true },
|
||||
{ "<leader>w", group = "[W]orkspace" },
|
||||
{ "<leader>w_", hidden = true },
|
||||
}
|
||||
-- register which-key VISUAL mode
|
||||
-- required for visual <leader>hs (hunk stage) to work
|
||||
require('which-key').register({
|
||||
['<leader>'] = { name = 'VISUAL <leader>' },
|
||||
['<leader>h'] = { 'Git [H]unk' },
|
||||
}, { mode = 'v' })
|
||||
require('which-key').add {
|
||||
{ "<leader>", group = "VISUAL <leader>", mode = "v" },
|
||||
{ "<leader>h", desc = "Git [H]unk", mode = "v" },
|
||||
}
|
||||
|
||||
-- mason-lspconfig requires that these setup functions are called in this order
|
||||
-- before setting up the servers.
|
||||
|
@ -14,11 +14,15 @@ vim.api.nvim_create_autocmd({ "FileType" }, {
|
||||
})
|
||||
|
||||
-- document existing key chains
|
||||
require('which-key').register {
|
||||
['<leader>n'] = { name = '[N]eorg', _ = 'which_key_ignore' },
|
||||
['<leader>m'] = { name = 'neorg [M]ode', _ = 'which_key_ignore' },
|
||||
['<leader>l'] = { name = 'neorg [L]ist', _ = 'which_key_ignore' },
|
||||
['<leader>ne'] = { name = '[N]eorg [E]xport', _ = 'which_key_ignore' },
|
||||
require('which-key').add {
|
||||
{ "<leader>l", group = "neorg [L]ist" },
|
||||
{ "<leader>l_", hidden = true },
|
||||
{ "<leader>m", group = "neorg [M]ode" },
|
||||
{ "<leader>m_", hidden = true },
|
||||
{ "<leader>n", group = "[N]eorg" },
|
||||
{ "<leader>n_", hidden = true },
|
||||
{ "<leader>ne", group = "[N]eorg [E]xport" },
|
||||
{ "<leader>ne_", hidden = true },
|
||||
}
|
||||
|
||||
vim.api.nvim_set_keymap("n", "<Leader>ni", ":Neorg index<CR>",
|
||||
|
@ -87,4 +87,7 @@ local options = {
|
||||
},
|
||||
}
|
||||
|
||||
-- XXX: temporary until upgrading the deprecated configuration above…
|
||||
options = {}
|
||||
|
||||
return options
|
||||
|
Loading…
Reference in New Issue
Block a user