Overview
The mapping configuration uses the nvim name shortcuts as:
<C>
-> Ctrl<leader>
-> Space<A>
-> alt<S>
-> shift- The default mappings are defined here.
Mapping format
-
NvChad uses
vim.keymap.set
by default, check:h vim.keymap.set
for detailed docs. -
The desc opt is optional. It's only needed for NvCheatsheet to document, First word in desc will be used for group heading.
-
NvCheatsheet groups require at least 2 mappings
local map = vim.keymap.set
map("n", "<leader>ff", "<cmd> Telescope <cr>")
-- multiple modes
map({ "i", "n" }, "<C-k>", "<Up>", { desc = "Move up" })
-- mapping with a lua function
map("n", "<A-i>", function()
-- do something
end, { desc = "Terminal toggle floating" })
-- Disable mappings
local nomap = vim.keymap.del
nomap("i", "<C-k>")
nomap("n", "<C-k>")
- Do know that lsp & gitsigns mappings wont be overrided by the above methods, because they dont load on startup & are lazy loaded. So put the lsp ones in
LspAttach
autocmd or right after your on_attach