nvim: add neotest

This commit is contained in:
mequidis
2023-01-20 21:10:28 +02:00
parent 327ed2820e
commit 67f14e7007
3 changed files with 51 additions and 0 deletions

View File

@ -105,6 +105,38 @@ vim.keymap.set("n", "]d", function()
vim.lsp.diagnostic.goto_next()
end)
-- neotest
vim.keymap.set("n", "na", function()
require("neotest").run.attach()
end)
vim.keymap.set("n", "nf", function()
require("neotest").run.run(vim.fn.expand("%"))
end)
vim.keymap.set("n", "nF", function()
require("neotest").run.run({ vim.fn.expand("%"), strategy = "dap" })
end)
vim.keymap.set("n", "nl", function()
require("neotest").run.run_last()
end)
vim.keymap.set("n", "nL", function()
require("neotest").run.run_last({ strategy = "dap" })
end)
vim.keymap.set("n", "nn", function()
require("neotest").run.run()
end)
vim.keymap.set("n", "nN", function()
require("neotest").run.run({ strategy = "dap" })
end)
vim.keymap.set("n", "no", function()
require("neotest").output.open({ enter = true })
end)
vim.keymap.set("n", "nS", function()
require("neotest").run.stop()
end)
vim.keymap.set("n", "ns", function()
require("neotest").summary.toggle()
end)
-- telekasten
vim.keymap.set("n", "<leader>z", function()
require("telekasten").panel()

View File

@ -110,6 +110,18 @@ require("packer").startup(function()
end,
})
-- neotest
use({
"nvim-neotest/neotest",
config = function()
require("plugins.neotest")
end,
requires = {
"antoinemadec/FixCursorHold.nvim",
"nvim-neotest/neotest-python",
},
})
-- fugitive
use({
"tpope/vim-fugitive",

View File

@ -0,0 +1,7 @@
require("neotest").setup({
adapters = {
require("neotest-python")({
runner = "pytest",
}),
},
})