diff options
Diffstat (limited to 'after/plugin/neotest.lua')
| -rw-r--r-- | after/plugin/neotest.lua | 57 |
1 files changed, 39 insertions, 18 deletions
diff --git a/after/plugin/neotest.lua b/after/plugin/neotest.lua index efbd159..4a7175c 100644 --- a/after/plugin/neotest.lua +++ b/after/plugin/neotest.lua @@ -1,27 +1,48 @@ local ok, neotest = pcall(require, "neotest") if not ok then - return + return end neotest.setup({ - adapters = { - require("neotest-go"), - require("neotest-vim-test")({ - ignore_file_types = { "go" }, - }), - }, + adapters = { + require("neotest-go"), + require("neotest-plenary"), + require("neotest-vim-test")({ + ignore_file_types = { "go", "lua" }, + }), + }, }) --- Not working for behat --- So add the leader, not ideal but for now is the best -vim.keymap.set("n", "<leader>t<C-n>", function() - neotest.run.run() -end, { silent = true, noremap = true }) +local hydra = require("hydra") -vim.keymap.set("n", "<leader>t<C-f>", function() - neotest.run.run(vim.fn.expand("%")) -end, { silent = true, noremap = true }) +local hint = [[ + NeoTest + _n_: Near test _f_: Current file _s_: Toggle Summary ^ + ^ ^ _<Esc>_ +]] -vim.keymap.set("n", "<leader>t<C-s>", function() - neotest.summary.toggle() -end, { silent = true, noremap = true }) +hydra({ + name = "neotest", + hint = hint, + mode = "n", + config = { + color = "teal", + invoke_on_body = true, + hint = { + border = "rounded", + position = "bottom", + } + }, + body = "<C-t>", + heads = { + { "n", neotest.run.run }, + { + "f", + function() + neotest.run.run(vim.fn.expand("%")) + end, + }, + { "s", neotest.summary.toggle }, + { '<Esc>', nil, { exit = true } } + }, +}) |