diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-07-19 23:09:41 +0200 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-07-19 23:09:41 +0200 |
| commit | aaac1f04614943dfaf90a23024d1b9b18ced9a6c (patch) | |
| tree | 9a2444f1c6e7edd4ff5f911fdeca2dfd42bac73a /after/plugin/neotest.lua | |
| parent | 4f2e69e86d5d374d5167be4e52bbb672c3713219 (diff) | |
| download | nvim-conf-aaac1f04614943dfaf90a23024d1b9b18ced9a6c.tar.gz nvim-conf-aaac1f04614943dfaf90a23024d1b9b18ced9a6c.zip | |
Add more hydras
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 } } + }, +}) |