From b627b0db5ffe2673d785d8daf978611b87eaf282 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Tue, 2 Apr 2024 00:52:37 +0200 Subject: Dotfiles: Nvim: Set keybinds for running tests --- dotfiles/nvim/init.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'dotfiles') diff --git a/dotfiles/nvim/init.lua b/dotfiles/nvim/init.lua index 3b8ee41..bd1a5b8 100644 --- a/dotfiles/nvim/init.lua +++ b/dotfiles/nvim/init.lua @@ -1,5 +1,4 @@ --[[ --- TODO: Add test leader key section and dont select completion on tab, only enter. ===================================================================== ==================== READ THIS BEFORE CONTINUING ==================== ===================================================================== @@ -242,9 +241,14 @@ require('lazy').setup({ { 'klen/nvim-test', config = function() require('nvim-test.runners.go-test'):setup { - args = { "test", "-tags", "dynamic" } + args = { "test", "-tags", "dynamic" } + } + require('nvim-test').setup { + vim.keymap.set('n', 'tf', function() require('nvim-test').run('file') end, { desc = '[T]est [F]ile' }), + vim.keymap.set('n', 'tn', function() require('nvim-test').run('nearest') end, { desc = '[T]est [N]earest' }), + vim.keymap.set('n', 'ts', function() require('nvim-test').run('suite') end, { desc = '[T]est [S]uite' }), + vim.keymap.set('n', 'tl', function() require('nvim-test').run_last() end, { desc = '[T]est [L]ast' }) } - require('nvim-test').setup() end }, -- cgit 1.4.1