aboutsummaryrefslogtreecommitdiffstats
path: root/nvim/after/plugin
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-04-08 15:40:05 +0100
committerMatthew Lemon <y@yulqen.org>2023-04-08 15:40:05 +0100
commitf3de025965079cc095c8aa43667e6d2153387f5b (patch)
tree1ef9c2afa4e0d8fa95cc85d4c6286cb2ced18053 /nvim/after/plugin
parent0eac8747676452721b123de4b361d3d6098c8033 (diff)
Adds a keybinding to neotest to attach a terminal
Using pdbpp is my preferred way to debug. This allows us to set a breakpoint in a function using breakpoint(), call the test using a neotest binding: the UI freezes. Then you can attach to a terminal where pdb will be waiting for you. Don't forget the method to exit a vim terminal!
Diffstat (limited to 'nvim/after/plugin')
-rw-r--r--nvim/after/plugin/neotest-python.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/nvim/after/plugin/neotest-python.lua b/nvim/after/plugin/neotest-python.lua
index 404695b..6637042 100644
--- a/nvim/after/plugin/neotest-python.lua
+++ b/nvim/after/plugin/neotest-python.lua
@@ -94,6 +94,11 @@ vim.keymap.set("n", "tr", function()
end,
{ noremap = true, silent = true, nowait = true })
+vim.keymap.set("n", "ta", function()
+ local neotest = require("neotest")
+ neotest.run.attach()
+end)
+
vim.keymap.set("n", "to", function()
local neotest = require("neotest")
neotest.output.open({ last_run = true, enter = true })