mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-09-01 08:15:20 +02:00
Make keymaps of bufferline and compe configurable (#1205)
This commit is contained in:
parent
3af0f98887
commit
d5557f56c8
2 changed files with 34 additions and 13 deletions
|
@ -1,2 +1,16 @@
|
||||||
vim.api.nvim_set_keymap("n", "<S-l>", ":BufferNext<CR>", { noremap = true, silent = true })
|
lvim.builtin.bufferline = {
|
||||||
vim.api.nvim_set_keymap("n", "<S-h>", ":BufferPrevious<CR>", { noremap = true, silent = true })
|
keymap = {
|
||||||
|
values = {
|
||||||
|
normal_mode = {
|
||||||
|
{ "<S-l>", ":BufferNext<CR>" },
|
||||||
|
{ "<S-h>", ":BufferPrevious<CR>" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
normal_mode = { noremap = true, silent = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local keymap = require "utils.keymap"
|
||||||
|
keymap.load(lvim.builtin.bufferline.keymap.values, lvim.builtin.bufferline.keymap.opts)
|
||||||
|
|
|
@ -38,6 +38,22 @@ M.config = function()
|
||||||
emoji = { kind = " ﲃ (Emoji)", filetypes = { "markdown", "text" } },
|
emoji = { kind = " ﲃ (Emoji)", filetypes = { "markdown", "text" } },
|
||||||
-- for emoji press : (idk if that in compe tho)
|
-- for emoji press : (idk if that in compe tho)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
keymap = {
|
||||||
|
values = {
|
||||||
|
insert_mode = {
|
||||||
|
{ "<Tab>", 'pumvisible() ? "<C-n>" : "<Tab>"' },
|
||||||
|
{ "<S-Tab>", 'pumvisible() ? "<C-p>" : "<S-Tab>"' },
|
||||||
|
{ "<C-Space>", "compe#complete()" },
|
||||||
|
{ "<C-e>", "compe#close('<C-e>')" },
|
||||||
|
{ "<C-f>", "compe#scroll({ 'delta': +4 })" },
|
||||||
|
{ "<C-d>", "compe#scroll({ 'delta': -4 })" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
insert_mode = { noremap = true, silent = true, expr = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -64,12 +80,6 @@ M.setup = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local remap = vim.api.nvim_set_keymap
|
|
||||||
|
|
||||||
remap("i", "<Tab>", 'pumvisible() ? "<C-n>" : "<Tab>"', { silent = true, noremap = true, expr = true })
|
|
||||||
|
|
||||||
remap("i", "<S-Tab>", 'pumvisible() ? "<C-p>" : "<S-Tab>"', { silent = true, noremap = true, expr = true })
|
|
||||||
|
|
||||||
-- Use (s-)tab to:
|
-- Use (s-)tab to:
|
||||||
--- move to prev/next item in completion menuone
|
--- move to prev/next item in completion menuone
|
||||||
--- jump to prev/next snippet's placeholder
|
--- jump to prev/next snippet's placeholder
|
||||||
|
@ -95,11 +105,8 @@ M.setup = function()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.api.nvim_set_keymap("i", "<C-Space>", "compe#complete()", { noremap = true, silent = true, expr = true })
|
local keymap = require "utils.keymap"
|
||||||
-- vim.api.nvim_set_keymap("i", "<CR>", "compe#confirm('<CR>')", { noremap = true, silent = true, expr = true })
|
keymap.load(lvim.builtin.compe.keymap.values, lvim.builtin.compe.keymap.opts)
|
||||||
vim.api.nvim_set_keymap("i", "<C-e>", "compe#close('<C-e>')", { noremap = true, silent = true, expr = true })
|
|
||||||
vim.api.nvim_set_keymap("i", "<C-f>", "compe#scroll({ 'delta': +4 })", { noremap = true, silent = true, expr = true })
|
|
||||||
vim.api.nvim_set_keymap("i", "<C-d>", "compe#scroll({ 'delta': -4 })", { noremap = true, silent = true, expr = true })
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue