aboutsummaryrefslogtreecommitdiffstats
path: root/after/plugin
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-06-22 08:37:16 +0200
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-06-22 08:37:16 +0200
commite02e3aec70d82a536d662c4c34e638bd9e1e6786 (patch)
treed332357d06b990f65672679d7a79cf646adf0b6a /after/plugin
parent3df9682eaf9adde3a8e8f7ef03328df37303178a (diff)
downloadnvim-conf-e02e3aec70d82a536d662c4c34e638bd9e1e6786.tar.gz
nvim-conf-e02e3aec70d82a536d662c4c34e638bd9e1e6786.zip
Add neotest
Diffstat (limited to 'after/plugin')
-rw-r--r--after/plugin/neotest.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/after/plugin/neotest.lua b/after/plugin/neotest.lua
new file mode 100644
index 0000000..d70d5cd
--- /dev/null
+++ b/after/plugin/neotest.lua
@@ -0,0 +1,25 @@
+local ok, neotest = pcall(require, "neotest")
+if not ok then
+ return
+end
+
+neotest.setup({
+ adapters = {
+ require("neotest-go"),
+ require("neotest-vim-test")({
+ ignore_file_types = { "go" },
+ }),
+ },
+})
+
+vim.keymap.set("n", "t<C-n>", function()
+ neotest.run.run()
+end, { silent = true, noremap = true })
+
+vim.keymap.set("n", "t<C-f>", function()
+ neotest.run.run(vim.fn.expand("%"))
+end, { silent = true, noremap = true })
+
+vim.keymap.set("n", "t<C-s>", function()
+ neotest.summary.toggle()
+end, { silent = true, noremap = true })