From e02e3aec70d82a536d662c4c34e638bd9e1e6786 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Wed, 22 Jun 2022 08:37:16 +0200 Subject: Add neotest --- after/plugin/neotest.lua | 25 +++++++++++++++++++++++++ lua/alpha/plugins.lua | 14 +++++++++++--- plugin/test.vim | 16 ++++++++-------- 3 files changed, 44 insertions(+), 11 deletions(-) create mode 100644 after/plugin/neotest.lua 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", function() + neotest.run.run() +end, { silent = true, noremap = true }) + +vim.keymap.set("n", "t", function() + neotest.run.run(vim.fn.expand("%")) +end, { silent = true, noremap = true }) + +vim.keymap.set("n", "t", function() + neotest.summary.toggle() +end, { silent = true, noremap = true }) diff --git a/lua/alpha/plugins.lua b/lua/alpha/plugins.lua index dc2b150..5062e5b 100644 --- a/lua/alpha/plugins.lua +++ b/lua/alpha/plugins.lua @@ -46,8 +46,6 @@ return require("packer").startup(function(use) }, }) - use({ "kevinhwang91/nvim-bqf", ft = "qf" }) - -- optional use({ "junegunn/fzf.vim" }) use({ @@ -142,8 +140,18 @@ return require("packer").startup(function(use) requires = "kyazdani42/nvim-web-devicons", }) - use("szw/vim-maximizer") use("vim-test/vim-test") + use { + "nvim-neotest/neotest", + requires = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "antoinemadec/FixCursorHold.nvim", + "nvim-neotest/neotest-go", + "nvim-neotest/neotest-vim-test", + } + } + use("rcarriga/nvim-notify") -- use("dracula/vim") diff --git a/plugin/test.vim b/plugin/test.vim index ebcf9b5..b51a9e1 100644 --- a/plugin/test.vim +++ b/plugin/test.vim @@ -1,9 +1,9 @@ -nmap t :TestNearest -nmap t :TestFile -nmap t :TestSuite -nmap t :TestLast -nmap t :TestVisit +" nmap t :TestNearest +" nmap t :TestFile +" nmap t :TestSuite +" nmap t :TestLast +" nmap t :TestVisit -let test#php#pest#executable = 'sail test' -let test#strategy = 'neovim' -let g:test#preserve_screen = 1 +" let test#php#pest#executable = 'sail test' +" let test#strategy = 'neovim' +" let g:test#preserve_screen = 1 -- cgit v1.2.3