Merge commit 'f4858d42a8' as 'config/nvim'

This commit is contained in:
neoteny 2021-11-28 22:27:34 +02:00
commit a6d1f45fd6
36 changed files with 906 additions and 0 deletions

27
config/nvim/lua/utils.lua Normal file
View file

@ -0,0 +1,27 @@
local M = {}
M.opts = { noremap = true, silent = true }
function M._map(mode, from, to, opts)
vim.api.nvim_set_keymap(mode, from, to, opts)
end
function M.map(mode, from, to)
if type(mode) == "table" then
for _, m in pairs(mode) do
M._map(m, from, to, M.opts)
end
end
M._map(mode, from, to, M.opts)
end
function M.nmap(from, to)
M._map("n", from, to, M.opts)
end
function M.expr(mode, from, to)
M._map(mode, from, to, { noremap = true, expr = true })
end
return M