From e5c8f244466ff4da4b12c1bbfd2292a8408ff1d2 Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Wed, 5 Jul 2023 21:26:02 -0400 Subject: Add Neovim config --- .config/nvim/lua/plugins/neotest.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .config/nvim/lua/plugins/neotest.lua (limited to '.config/nvim/lua/plugins/neotest.lua') diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua new file mode 100644 index 0000000..74817a5 --- /dev/null +++ b/.config/nvim/lua/plugins/neotest.lua @@ -0,0 +1,33 @@ +return { + { + "nvim-neotest/neotest", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "antoinemadec/FixCursorHold.nvim", + + "nvim-neotest/neotest-python", + }, + keys = { + { "tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run buffer" }, + { "tT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run all files" }, + { "tr", function() require("neotest").run.run() end, desc = "Run nearest test" }, + { "td", function() require("neotest").run.run({strategy="dap"}) end, desc = "Debug nearest test" }, + { "ts", function() require("neotest").summary.toggle() end, desc = "Toggle summary" }, + { "to", function() require("neotest").output.open({enter=true, auto_close=true}) end, desc = "Show output" }, + { "tO", function() require("neotest").output_panel.toggle() end, desc = "Toggle output panel" }, + { "tS", function() require("neotest").run.stop() end, desc = "Stop" }, + { "twt", function() require("neotest").watch.watch(vim.fn.expand("%")) end, desc = "Watch buffer" }, + { "twT", function() require("neotest").watch.watch(vim.loop.cwd()) end, desc = "Watch all files" }, + { "twr", function() require("neotest").watch.watch() end, desc = "Watch nearest test" }, + { "tws", function() require("neotest").watch.stop() end, desc = "Stop watching" }, + }, + config = function() + require("neotest").setup({ + adapters = { + require("neotest-python"), + }, + }) + end, + }, +} -- cgit v1.2.3