Make nvim lua testing keymaps buffer local

main
Ensar Sarajčić 2022-05-08 23:15:34 +02:00
parent 399b9acabd
commit b0ad250291
1 changed files with 6 additions and 5 deletions

View File

@ -49,10 +49,11 @@ vim.api.nvim_create_autocmd("FileType", {
pattern = "lua",
group = au_id,
callback = function()
vim.keymap.set("n", "<Leader>tn", ":PlenaryTestFile<CR>", opts)
vim.keymap.set("n", "<Leader>tf", ":PlenaryTestFile<CR>", opts)
vim.keymap.set("n", "<Leader>ts", ":PlenaryTestSuite<CR>", opts)
vim.keymap.set("n", "<Leader>tl", ":PlenaryTestLast<CR>", opts)
vim.keymap.set("n", "<Leader>tg", ":PlenaryVisitLastTest<CR>", opts)
local local_opts = { silent = true, buffer = true }
vim.keymap.set("n", "<Leader>tn", ":PlenaryTestFile<CR>", local_opts)
vim.keymap.set("n", "<Leader>tf", ":PlenaryTestFile<CR>", local_opts)
vim.keymap.set("n", "<Leader>ts", ":PlenaryTestSuite<CR>", local_opts)
vim.keymap.set("n", "<Leader>tl", ":PlenaryTestLast<CR>", local_opts)
vim.keymap.set("n", "<Leader>tg", ":PlenaryVisitLastTest<CR>", local_opts)
end,
})