require "nvchad.mappings" local nomap = vim.keymap.del nomap("n", "x") nomap("n", "cc") nomap("n", "ch") nomap("n", "cm") nomap("n", "v") local map = vim.keymap.set map("n", ";", ":", { desc = "CMD enter command mode" }) map("i", "jk", "") -- Group names map("n", "f", "", { desc = "Find" }) map("n", "l", "", { desc = "LSP" }) map("n", "g", "", { desc = "Git" }) map("n", "t", "", { desc = "Terminal" }) -- General map("n", "q", "confirm q", { desc = "quit" }) map("n", "h", "noh", { desc = "No Highlight" }) map("n", ";", "Nvdash", { desc = "Dashboard" }) map("n", "c", function() require("nvchad.tabufline").close_buffer() end, { desc = "buffer close" }) map("n", "rd", " lua require('rainbow-delimiters').toggle() ", { desc = "Toggle rainbow delimiters" }) -- Lsp map( "n", "lf", " lua require('conform').format { lsp_fallback = true }", { desc = "General Format file" } ) map({ "n", "v" }, "la", vim.lsp.buf.code_action, { desc = "Code action" }) map("n", "gD", vim.lsp.buf.declaration, { desc = "Go to declaration" }) map("n", "gd", vim.lsp.buf.definition, { desc = "Go to definition" }) map("n", "gi", vim.lsp.buf.implementation, { desc = "Go to implementation" }) map("n", "gr", vim.lsp.buf.references, { desc = "Show references" }) map("n", "lr", function() require "nvchad.lsp.renamer"() end, {desc = "NvRenamer"}) -- Git map("n", "gm", "Telescope git_commits", { desc = "telescope git commits" }) map({ "n", "t" }, "gg", function() require("nvchad.term").runner { pos = "float", cmd = "gitui && exit", id = "gue", clear_cmd = true, } end, { desc = "Gitui" }) -- term map({ "n", "t" }, "tr", function() require("nvchad.term").toggle { pos = "float", id = "floatTerm" } end, { desc = "Terminal Toggle Floating term" }) map({ "n", "t" }, "tt", function() require("nvchad.term").toggle { pos = "sp", id = "hTerm" } end, { desc = "Terminal Toggle Horizontal term" }) map({ "n", "t" }, "tg", function() require("nvchad.term").toggle { pos = "vsp", id = "VTerm" } end, { desc = "Terminal Toggle Vertical term" }) -- cmp local cmp = require "cmp" cmp.setup { mapping = { [""] = cmp.mapping(cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Select }, { "i" }), [""] = cmp.mapping(cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Select }, { "i" }), }, }