about summary refs log tree commit diff
path: root/dotfiles
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2024-04-02 00:52:37 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2024-04-02 01:03:21 +0200
commitb627b0db5ffe2673d785d8daf978611b87eaf282 (patch)
tree1dca14d823f5acd618714d10e8589a7ac06b1a00 /dotfiles
parentDotfiles: Nvim: Dont accept lsp completion on tab (diff)
downloadnixos-config-b627b0db5ffe2673d785d8daf978611b87eaf282.tar.gz
nixos-config-b627b0db5ffe2673d785d8daf978611b87eaf282.tar.bz2
nixos-config-b627b0db5ffe2673d785d8daf978611b87eaf282.zip
Dotfiles: Nvim: Set keybinds for running tests
Diffstat (limited to 'dotfiles')
-rw-r--r--dotfiles/nvim/init.lua10
1 files changed, 7 insertions, 3 deletions
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', '<leader>tf', function() require('nvim-test').run('file') end, { desc = '[T]est [F]ile' }),
+        vim.keymap.set('n', '<leader>tn', function() require('nvim-test').run('nearest') end, { desc = '[T]est [N]earest' }),
+        vim.keymap.set('n', '<leader>ts', function() require('nvim-test').run('suite') end, { desc = '[T]est [S]uite' }),
+        vim.keymap.set('n', '<leader>tl', function() require('nvim-test').run_last() end, { desc = '[T]est [L]ast' })
       }
-      require('nvim-test').setup()
     end
   },