From f3de025965079cc095c8aa43667e6d2153387f5b Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sat, 8 Apr 2023 15:40:05 +0100 Subject: 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! --- nvim/after/plugin/neotest-python.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nvim/after') 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 }) -- cgit v1.2.3