Put configuration elements in different files

This commit is contained in:
Yorick Barbanneau 2022-01-03 23:45:30 +01:00
parent d6a419cfdd
commit 0fcc53b2cf
6 changed files with 171 additions and 170 deletions

View file

@ -0,0 +1,17 @@
function map(key)
-- get the extra options
local opts = {noremap = true}
for i, v in pairs(key) do
if type(i) == 'string' then opts[i] = v end
end
-- basic support for buffer-scoped keybindings
local buffer = opts.buffer
opts.buffer = nil
if buffer then
vim.api.nvim_buf_set_keymap(0, key[1], key[2], key[3], opts)
else
vim.api.nvim_set_keymap(key[1], key[2], key[3], opts)
end
end