diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-22 00:08:36 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-07-22 00:08:36 +0200 |
commit | b51f1ae28924a752258e7607fbc3210f9b18eaac (patch) | |
tree | 8c8c095528990b3f6eb499dbcca15e9720e636d1 /.config/nvim/lua/core/dap.lua | |
parent | da936b0ed9ac4c171d3c7908e41af1875a82b08b (diff) |
Updates based on Chris's lunarvim
Diffstat (limited to '.config/nvim/lua/core/dap.lua')
-rw-r--r-- | .config/nvim/lua/core/dap.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/.config/nvim/lua/core/dap.lua b/.config/nvim/lua/core/dap.lua new file mode 100644 index 0000000..bc76e22 --- /dev/null +++ b/.config/nvim/lua/core/dap.lua @@ -0,0 +1,41 @@ +local M = {} +M.config = function() + O.plugin.dap = { + active = false, + breakpoint = { + text = "", + texthl = "LspDiagnosticsSignError", + linehl = "", + numhl = "", + }, + } +end + +M.setup = function() + local status_ok, dap = pcall(require, "dap") + if not status_ok then + return + end + + vim.fn.sign_define("DapBreakpoint", O.plugin.dap.breakpoint) + dap.defaults.fallback.terminal_win_cmd = "50vsplit new" + + O.user_which_key["d"] = { + name = "Debug", + t = { "<cmd>lua require'dap'.toggle_breakpoint()<cr>", "Toggle Breakpoint" }, + b = { "<cmd>lua require'dap'.step_back()<cr>", "Step Back" }, + c = { "<cmd>lua require'dap'.continue()<cr>", "Continue" }, + C = { "<cmd>lua require'dap'.run_to_cursor()<cr>", "Run To Cursor" }, + d = { "<cmd>lua require'dap'.disconnect()<cr>", "Disconnect" }, + g = { "<cmd>lua require'dap'.session()<cr>", "Get Session" }, + i = { "<cmd>lua require'dap'.step_into()<cr>", "Step Into" }, + o = { "<cmd>lua require'dap'.step_over()<cr>", "Step Over" }, + u = { "<cmd>lua require'dap'.step_out()<cr>", "Step Out" }, + p = { "<cmd>lua require'dap'.pause.toggle()<cr>", "Pause" }, + r = { "<cmd>lua require'dap'.repl.toggle()<cr>", "Toggle Repl" }, + s = { "<cmd>lua require'dap'.continue()<cr>", "Start" }, + q = { "<cmd>lua require'dap'.stop()<cr>", "Quit" }, + } +end + +return M |