From 5455aacdedfb2829f000b2f120a6d5194d1227f8 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Sun, 22 Jan 2023 10:18:07 +0100 Subject: feat: big change on the structure of the plugins, move several things to config dir --- lua/plugins/neotest.lua | 64 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 lua/plugins/neotest.lua (limited to 'lua/plugins/neotest.lua') diff --git a/lua/plugins/neotest.lua b/lua/plugins/neotest.lua new file mode 100644 index 0000000..5a332be --- /dev/null +++ b/lua/plugins/neotest.lua @@ -0,0 +1,64 @@ +return { + "nvim-neotest/neotest", + enabled = false, + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "antoinemadec/FixCursorHold.nvim", + "nvim-neotest/neotest-go", + "rouge8/neotest-rust", + "nvim-neotest/neotest-plenary", + "nvim-neotest/neotest-vim-test", + "anuvyklack/hydra.nvim", + }, + config = function() + local neotest = require("neotest") + neotest.setup({ + adapters = { + require("neotest-go"), + require("neotest-rust"), + require("neotest-plenary"), + require("neotest-vim-test")({ + ignore_file_types = { "go", "lua", "rust", "php" }, + }), + -- require("laravel.neotest"), + }, + }) + + local hydra = require("hydra") + + local hint = [[ + NeoTest + _n_: Near test _f_: Current file _l_: Last Test _m_: Run Marked _s_: Toggle Summary ^ + ^ ^ __ + ]] + + hydra({ + name = "neotest", + hint = hint, + mode = "n", + config = { + color = "teal", + invoke_on_body = true, + hint = { + border = "rounded", + position = "bottom", + }, + }, + body = "", + heads = { + { "n", neotest.run.run }, + { + "f", + function() + neotest.run.run(vim.fn.expand("%")) + end, + }, + { "l", neotest.run.run_last }, + { "m", neotest.summary.run_marked }, + { "s", neotest.summary.toggle }, + { "", nil, { exit = true } }, + }, + }) + end +} -- cgit v1.2.3