nvim: add neotest

This commit is contained in:
2023-07-08 15:20:42 +03:00
parent e2219da268
commit 4dd022993d
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() vim.lsp.diagnostic.goto_next()
end) 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 -- telekasten
vim.keymap.set("n", "<leader>z", function() vim.keymap.set("n", "<leader>z", function()
require("telekasten").panel() require("telekasten").panel()

View File

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

View File

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