tb-dotfiles/chezmoi/private_dot_config/nvim/lua/helpers/keys.lua

22 lines
456 B
Lua
Raw Normal View History

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