require "nvchad.mappings" -- add yours here local vim = vim local map = vim.keymap.set local g = vim.g local diag = vim.diagnostic map("n", ";", ":", { desc = "CMD enter command mode" }) map("i", "jk", "") -- map({ "n", "i", "v" }, "", " w ") map("n", "cp", " Copilot panel", { desc = "Copilot panel" }) map("n", "ca", function() vim.lsp.buf.code_action() end, { desc = "LSP code action" }) map("n", "tt", function() require("base46").toggle_transparency() end, { desc = "Toggle transparency" }) map("n", "J", "mzJ`z", { desc = "Concatenate line below cursor but does not move the cursor" }) map("n", "o", ':call append(line("."), repeat([""], v:count1))', { desc = "Insert line below" }) map("n", "O", ':call append(line(".")-1, repeat([""], v:count1))', { desc = "Insert line above" }) map("n", "", "zz") map("n", "", "zz") map("n", "lg", " LazyGit", { desc = "LazyGit" }) -- Visual mode map("v", "J", ":m '>+1gv=gv", { desc = "Move line w/indentation" }) map("v", "K", ":m '<-2gv=gv", { desc = "Move line w/indentation" }) map("v", ">", ">gv", { desc = "indent" }) map("v", "<", "lt", Toggle_diagnostics, { noremap = true, silent = true, desc = "Toggle vim diagnostics" }) -- select a session to load map("n", "qs", function() require("persistence").select() end, { desc = "Select session to load" }) -- load the last session map("n", "ql", function() require("persistence").load { last = true } end, { desc = "Load last session" }) -- stop Persistence => session won't be saved on exit map("n", "qd", function() require("persistence").stop() end, { desc = "Stop persistence" }) -- debug related stuff local dap = require "dap" map("n", "db", function() dap.toggle_breakpoint() end, { desc = "Toggle breakpoint" }) map("n", "dc", function() dap.continue() end, { desc = "Continue" }) map("n", "dr", function() dap.repl.open() end, { desc = "Open REPL" }) map("n", "ds", function() dap.step_over() end, { desc = "Step over" }) map("n", "di", function() dap.step_into() end, { desc = "Step into" }) map("n", "do", function() dap.step_out() end, { desc = "Step out" }) map("n", "dT", function() dap.terminate() end, { desc = "Terminate" }) map("n", "dl", function() dap.run_last() end, { desc = "Run Last" }) map("n", "dC", function() dap.run_to_cursor() end, { desc = "Run to Cursor" }) -- dapui local dapui = require "dapui" local widgets = require "dap.ui.widgets" map("n", "du", function() dapui.toggle() end, { desc = "Toggle UI" }) map({ "n", "v" }, "dh", function() widgets.hover() end, { desc = "Hover" }) map({ "n", "v" }, "dp", function() widgets.preview() end, { desc = "Preview" }) map("n", "df", function() widgets.centered_float(widgets.frames) end, { desc = "Frames" }) map("n", "ds", function() widgets.centered_float(widgets.scopes) end, { desc = "Scopes" })