tb-dotfiles/chezmoi/private_dot_config/nvim/lua/helpers/keys.lua
2023-06-20 17:13:50 -04:00

21 lines
456 B
Lua

local M = {}
M.map = function(mode, lhs, rhs, desc)
vim.keymap.set(mode, lhs, rhs, { silent = true, desc = desc })
end
M.lsp_map = function(lhs, rhs, bufnr, desc)
vim.keymap.set("n", lhs, rhs, { silent = true, buffer = bufnr, desc = desc })
end
M.dap_map = function(mode, lhs, rhs, desc)
M.map(mode, lhs, rhs, desc)
end
M.set_leader = function(key)
vim.g.mapleader = key
vim.g.maplocalleader = key
M.map({ "n", "v" }, key, "<nop>")
end
return M