Add command mode key mapping table (#1306)

This commit is contained in:
Marcelo Cerri 2021-08-14 09:16:08 -03:00 committed by GitHub
parent 9c9bcb1e0a
commit a42cde2638
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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