diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-04-17 09:06:32 +0200 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-04-17 09:06:59 +0200 |
| commit | 45c3ddad7091776bdcc532a11bc59ca5debbafa7 (patch) | |
| tree | a54b7e4316c06f291a4684bc893b85c42617736f /lua/plugins/test.lua | |
| parent | e53d98c4660f3dbb28dca7b3e6a5c30d8cd4fb2c (diff) | |
| download | nvim-conf-45c3ddad7091776bdcc532a11bc59ca5debbafa7.tar.gz nvim-conf-45c3ddad7091776bdcc532a11bc59ca5debbafa7.zip | |
remove unnecessary extra database config file. disable rest, update test config
Diffstat (limited to 'lua/plugins/test.lua')
| -rw-r--r-- | lua/plugins/test.lua | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/lua/plugins/test.lua b/lua/plugins/test.lua index aa9cba7..e2cfb59 100644 --- a/lua/plugins/test.lua +++ b/lua/plugins/test.lua @@ -7,21 +7,36 @@ return { config = function() local hydra = require "hydra" - vim.g["test#preserve_screen"] = 1 - vim.cmd [[ let test#php#pest#executable = './vendor/bin/sail test' - let test#strategy = 'neovim' + let test#strategy = 'harpoon' let test#neovim#term_position = 'vert' - let g:test#preserve_screen = 1 + let g:test#preserve_screen = 0 + let g:test#harpoon_term = 3 + let g:test#harpoon#gototerminal= 0 ]] local hint = [[ Vim Tests _n_: Near test _f_: Current file _s_: Test Suit ^ _l_: Test Last _g_: Visit + _w_: Watch last Test _p_: stop watch ^ ^ _<Esc>_ ^ ]] + local auto_cmd_id = nil + local stopAutoCommand = function() + if auto_cmd_id ~= nil then + vim.api.nvim_del_autocmd(auto_cmd_id) + auto_cmd_id = nil + end + end + local startAutoCommand = function() + stopAutoCommand() + auto_cmd_id = vim.api.nvim_create_autocmd({"BufWritePost"}, { + pattern = {"*.php", "*.feature", "*.yaml"}, + command = "TestLast", + }) + end hydra { name = "vimtest", @@ -42,6 +57,8 @@ return { { "s", ":TestSuit<CR>" }, { "l", ":TestLast<CR>" }, { "g", ":TestVisit<CR>" }, + { "w", startAutoCommand }, + { "p", stopAutoCommand }, { "<Esc>", nil, { exit = true } }, }, } |