require "nvchad.mappings" local nomap = vim.keymap.del nomap("n", "x") nomap("n", "ch") nomap("n", "cm") nomap("n", "v") nomap("n", "ds") nomap("n", "ma") nomap("n", "pt") 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" }) map("n", "d", "", { desc = "Diagnostic" }) -- General map("n", "q", "confirm q", { desc = "quit" }) map("n", "h", "noh", { desc = "No Highlight" }) map("n", ";", "Nvdash", { desc = "Dashboard" }) map("n", "c", " lua require('nvchad.tabufline').close_buffer()", { desc = "buffer close" }) map("n", "rd", " lua require('rainbow-delimiters').toggle() ", { desc = "Toggle rainbow delimiters" }) -- Lsp map( "n", "lf", " lua require('conform').format { lsp_format = \"last\", }", { desc = "General Format file" } ) map({ "n", "v" }, "la", require("actions-preview").code_actions, { 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", "ld", vim.diagnostic.setloclist, { desc = "LSP Diagnostic loclist" }) map("n", "lr", " lua require 'nvchad.lsp.renamer' ()", { desc = "NvRenamer" }) -- Diagnostic map("n", "dd", function() vim.diagnostic.jump { count = 1, float = false } end, { desc = "LSP next diag" }) map("n", "df", function() vim.diagnostic.jump { count = 1, float = true } end, { desc = "LSP next diag" }) map("n", "ds", function() vim.diagnostic.jump { count = -1, float = true } end, { desc = "LSP prev diag" }) -- 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" }) -- Telescope map("n", "fm", "Telescope marks", { desc = "telescope find marks" }) map("n", "fh", "Telescope terms", { desc = "telescope pick hidden term" }) map("n", "fp", "Telescope projects", { desc = "Show projects" }) -- 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" }), }, }