local map = vim.keymap.set -- Normal mode map("n", "", "enew", { desc = "New File" }) map("n", "", "NvimTreeToggle", { desc = "Toggle file explorer" }) map("n", "", "qa", { desc = "Quit all" }) map("n", "l", "Lazy", { desc = "Lazy" }) map("n", "f", "Telescope find_files", { desc = "Find files" }) map("n", "r", "Telescope oldfiles", { desc = "Recent files" }) map("n", "s", "Telescope symbols", { desc = "Symbols" }) map("n", "cf", vim.lsp.buf.format, { desc = "Format" }) map("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) map("n", "gr", vim.lsp.buf.references, { desc = "Go to references" }) -- Visual mode map("v", "<", "", ">gv") -- Mixed modes map({ "i", "n" }, "", "noh", { desc = "Clear search" }) map({ "i", "v", "n", "s" }, "", "w", { desc = "Save file" }) -- Toggle comment map("n", "/", "lua require('Comment.api').toggle.linewise.current()", { desc = "Toggle comment" }) map("v", "/", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", { desc = "Toggle comment" })