diff options
author | Chris <[email protected]> | 2021-07-05 00:52:36 -0400 |
---|---|---|
committer | Chris <[email protected]> | 2021-07-05 00:52:36 -0400 |
commit | af5d292fbf51946ed508222cdefca3caed364971 (patch) | |
tree | f15886cae9937e004ce34832802e9840b38c628c | |
parent | 4bbf4c290a4a61e70717f3ea52567d2cacfdedae (diff) |
basic python debugging
-rw-r--r-- | ftplugin/python.lua | 3 | ||||
-rw-r--r-- | lua/lv-which-key/init.lua | 55 | ||||
-rw-r--r-- | lua/plugins.lua | 8 |
3 files changed, 36 insertions, 30 deletions
diff --git a/ftplugin/python.lua b/ftplugin/python.lua index abb75e2a..04fe2ded 100644 --- a/ftplugin/python.lua +++ b/ftplugin/python.lua @@ -75,3 +75,6 @@ if O.lang.python.autoformat then }, } end + +local dap_install = require("dap-install") +dap_install.config("python_dbg", {}) diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 4e27a528..fb060b78 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -150,23 +150,22 @@ local mappings = { -- " Debug Adapter protocol: -- " https://microsoft.github.io/debug-adapter-protocol/ -- " Debugging - -- command! DebugToggleBreakpoint lua require'dap'.toggle_breakpoint() - -- command! DebugStart lua require'dap'.continue() - -- command! DebugContinue lua require'dap'.continue() - -- command! DebugStepOver lua require'dap'.step_over() - -- command! DebugStepOut lua require'dap'.step_out() - -- command! DebugStepInto lua require'dap'.step_into() - -- command! DebugToggleRepl lua require'dap'.repl.toggle() - -- command! DebugGetSession lua require'dap'.session() - -- D = { - -- name = "Debug", - -- b = {"<cmd>DebugToggleBreakpoint<cr>", "Toggle Breakpoint"}, - -- c = {"<cmd>DebugContinue<cr>", "Continue"}, - -- i = {"<cmd>DebugStepInto<cr>", "Step Into"}, - -- o = {"<cmd>DebugStepOver<cr>", "Step Over"}, - -- r = {"<cmd>DebugToggleRepl<cr>", "Toggle Repl"}, - -- s = {"<cmd>DebugStart<cr>", "Start"} - -- }, + 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"} + }, g = { name = "Git", j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" }, @@ -263,17 +262,17 @@ if O.plugin.spectre.active then } end -if O.plugin.trouble.active then - mappings["d"] = { - name = "Diagnostics", - t = { "<cmd>TroubleToggle<cr>", "trouble" }, - w = { "<cmd>TroubleToggle lsp_workspace_diagnostics<cr>", "workspace" }, - d = { "<cmd>TroubleToggle lsp_document_diagnostics<cr>", "document" }, - q = { "<cmd>TroubleToggle quickfix<cr>", "quickfix" }, - l = { "<cmd>TroubleToggle loclist<cr>", "loclist" }, - r = { "<cmd>TroubleToggle lsp_references<cr>", "references" }, - } -end +-- if O.plugin.trouble.active then +-- mappings["d"] = { +-- name = "Diagnostics", +-- t = { "<cmd>TroubleToggle<cr>", "trouble" }, +-- w = { "<cmd>TroubleToggle lsp_workspace_diagnostics<cr>", "workspace" }, +-- d = { "<cmd>TroubleToggle lsp_document_diagnostics<cr>", "document" }, +-- q = { "<cmd>TroubleToggle quickfix<cr>", "quickfix" }, +-- l = { "<cmd>TroubleToggle loclist<cr>", "loclist" }, +-- r = { "<cmd>TroubleToggle lsp_references<cr>", "references" }, +-- } +-- end if O.plugin.gitlinker.active then mappings["gy"] = "Gitlink" diff --git a/lua/plugins.lua b/lua/plugins.lua index 00417b6e..e03f5037 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -253,7 +253,11 @@ return require("packer").startup(function(use) -- Debugging use { "mfussenegger/nvim-dap", - event = "BufRead", + config = function() + require('dap') + vim.fn.sign_define('DapBreakpoint', {text='🛑', texthl='', linehl='', numhl=''}) + require('dap').defaults.fallback.terminal_win_cmd = '50vsplit new' + end, disable = not O.plugin.debug.active, } -- Better quickfix @@ -404,7 +408,7 @@ return require("packer").startup(function(use) -- Debugger management use { "Pocco81/DAPInstall.nvim", - event = "BufRead", + -- event = "BufRead", disable = not O.plugin.dap_install.active, } |