Put configuration elements in different files
This commit is contained in:
parent
d6a419cfdd
commit
0fcc53b2cf
6 changed files with 171 additions and 170 deletions
17
conf/nvim/lua/functions.lua
Normal file
17
conf/nvim/lua/functions.lua
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue