local map = function(mode, lhs, rhs, info) vim.keymap.set(mode, lhs, rhs, { desc = info }) end -- Basics map("n", "", "enew", "New File") map({ "i", "n", "s", "v" }, "", "w", "Save file") map("n", "", "qa", "Quit all") map({ "i", "n" }, "", "noh", "Clear search") -- Indenting map("v", "<", "", ">gv") -- LSP map("n", "gd", vim.lsp.buf.definition, "Go to definition") map("n", "gr", vim.lsp.buf.references, "Go to references") map("n", "cf", vim.lsp.buf.format, "Format") -- Toggle comment map("n", "", "lua require('Comment.api').toggle.linewise.current()", "Toggle comment") map("v", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", "Toggle comment") -- Normal mode map("n", "", "NvimTreeToggle", "Toggle tree") map("n", "l", "Lazy", "Lazy") map("n", "f", "Telescope find_files", "Find files") map("n", "r", "Telescope oldfiles", "Recent files") map({ "n", "t" }, "", "lua require('nvterm.terminal').toggle('float')", "Toggle terminal")