local function map(mode, lhs, rhs, desc, opts) local options = { noremap = true, silent = true } if opts then options = vim.tbl_extend("force", options, opts) end vim.keymap.set(mode, lhs, rhs, vim.tbl_extend("force", options, { desc = desc })) end -- Buffer navigation map("n", "", "bp", "") map("n", "", "bn", "") map("n", "bb", "e #", "Switch to other buffer") map("n", "`", "e #", "Switch to other buffer") map("n", "bd", "bd", "Delete buffer") map("n", "bp", "bp", "Previous buffer") map("n", "bn", "bn", "Next buffer") -- Better indentation map("v", "<", "", ">gv") -- Lazy map("n", "l", "Lazy", "Lazy") -- Mason map("n", "cm", "Mason", "Mason") -- Clear search on escape map({ "i", "n", "s" }, "", function() vim.cmd("noh") return "" end, "", { expr = true })