From b0ad2502912406b96714ff5a76ee44813324cd40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Sun, 8 May 2022 23:15:34 +0200 Subject: [PATCH] Make nvim lua testing keymaps buffer local --- symlinks/config/nvim/after/plugin/testing.lua | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/symlinks/config/nvim/after/plugin/testing.lua b/symlinks/config/nvim/after/plugin/testing.lua index 79619e1..f5c12a0 100644 --- a/symlinks/config/nvim/after/plugin/testing.lua +++ b/symlinks/config/nvim/after/plugin/testing.lua @@ -49,10 +49,11 @@ vim.api.nvim_create_autocmd("FileType", { pattern = "lua", group = au_id, callback = function() - vim.keymap.set("n", "tn", ":PlenaryTestFile", opts) - vim.keymap.set("n", "tf", ":PlenaryTestFile", opts) - vim.keymap.set("n", "ts", ":PlenaryTestSuite", opts) - vim.keymap.set("n", "tl", ":PlenaryTestLast", opts) - vim.keymap.set("n", "tg", ":PlenaryVisitLastTest", opts) + local local_opts = { silent = true, buffer = true } + vim.keymap.set("n", "tn", ":PlenaryTestFile", local_opts) + vim.keymap.set("n", "tf", ":PlenaryTestFile", local_opts) + vim.keymap.set("n", "ts", ":PlenaryTestSuite", local_opts) + vim.keymap.set("n", "tl", ":PlenaryTestLast", local_opts) + vim.keymap.set("n", "tg", ":PlenaryVisitLastTest", local_opts) end, })