mirror of
https://github.com/LunarVim/LunarVim.git
synced 2024-09-20 18:45:08 +02:00
Add command mode key mapping table (#1306)
This commit is contained in:
parent
9c9bcb1e0a
commit
a42cde2638
1 changed files with 10 additions and 0 deletions
|
@ -8,6 +8,7 @@ local generic_opts = {
|
|||
normal_mode = generic_opts_any,
|
||||
visual_mode = generic_opts_any,
|
||||
visual_block_mode = generic_opts_any,
|
||||
command_mode = generic_opts_any,
|
||||
term_mode = { silent = true },
|
||||
}
|
||||
|
||||
|
@ -17,6 +18,7 @@ local mode_adapters = {
|
|||
term_mode = "t",
|
||||
visual_mode = "v",
|
||||
visual_block_mode = "x",
|
||||
command_mode = "c",
|
||||
}
|
||||
|
||||
-- Append key mappings to lunarvim's defaults for a given mode
|
||||
|
@ -142,6 +144,14 @@ function M.config()
|
|||
["<A-j>"] = ":m '>+1<CR>gv-gv",
|
||||
["<A-k>"] = ":m '<-2<CR>gv-gv",
|
||||
},
|
||||
|
||||
---@usage change or add keymappings for command mode
|
||||
command_mode = {
|
||||
-- navigate tab completion with <c-j> and <c-k>
|
||||
-- runs conditionally
|
||||
["<C-j>"] = { 'pumvisible() ? "\\<C-n>" : "\\<C-j>"', { expr = true, noremap = true } },
|
||||
["<C-k>"] = { 'pumvisible() ? "\\<C-p>" : "\\<C-k>"', { expr = true, noremap = true } },
|
||||
},
|
||||
}
|
||||
|
||||
if vim.fn.has "mac" == 1 then
|
||||
|
|
Loading…
Reference in a new issue