aboutsummaryrefslogtreecommitdiffstats
path: root/after/plugin
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-07-19 23:09:41 +0200
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-07-19 23:09:41 +0200
commitaaac1f04614943dfaf90a23024d1b9b18ced9a6c (patch)
tree9a2444f1c6e7edd4ff5f911fdeca2dfd42bac73a /after/plugin
parent4f2e69e86d5d374d5167be4e52bbb672c3713219 (diff)
downloadnvim-conf-aaac1f04614943dfaf90a23024d1b9b18ced9a6c.tar.gz
nvim-conf-aaac1f04614943dfaf90a23024d1b9b18ced9a6c.zip
Add more hydras
Diffstat (limited to 'after/plugin')
-rw-r--r--after/plugin/hydra.lua1
-rw-r--r--after/plugin/neotest.lua57
-rw-r--r--after/plugin/trouble.lua2
3 files changed, 41 insertions, 19 deletions
diff --git a/after/plugin/hydra.lua b/after/plugin/hydra.lua
index 0255a4e..e190916 100644
--- a/after/plugin/hydra.lua
+++ b/after/plugin/hydra.lua
@@ -13,6 +13,7 @@ hydra({
{ 'h', '<C-w>h' },
{ 'j', '<C-w>j' },
{ 'k', '<C-w>k' },
+ { 'q', '<C-w>q' },
{ 'L', '<C-w>2>' },
{ 'H', '<C-w>2<' },
{ 'J', '<C-w>2-' },
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 } }
+ },
+})
diff --git a/after/plugin/trouble.lua b/after/plugin/trouble.lua
index 2fbb23d..a2730a7 100644
--- a/after/plugin/trouble.lua
+++ b/after/plugin/trouble.lua
@@ -6,4 +6,4 @@ end
trouble.setup {}
-vim.keymap.set('n', '<leader>tt', ':TroubleToggle<cr>')
+--vim.keymap.set('n', '<leader>tt', ':TroubleToggle<cr>')