mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2025-07-03 00:49:26 +00:00
[neovim] Add commands and keymaps to Neotest
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
local neotest_ns = vim.api.nvim_create_namespace("neotest")
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = {
|
||||
format = function(diagnostic)
|
||||
@ -7,8 +8,33 @@ vim.diagnostic.config({
|
||||
end,
|
||||
},
|
||||
}, neotest_ns)
|
||||
require("neotest").setup({
|
||||
|
||||
vim.api.nvim_create_user_command("CopyDirectoryPath", function()
|
||||
local path = vim.fn.expand("%:p:h")
|
||||
vim.fn.setreg("+", path)
|
||||
vim.notify('Copied "' .. path .. '" to the clipboard!')
|
||||
end, {})
|
||||
|
||||
|
||||
local neotest = require("neotest")
|
||||
|
||||
neotest.setup({
|
||||
adapters = {
|
||||
require("neotest-go"),
|
||||
require("neotest-go")({
|
||||
recursive_run = true,
|
||||
experimental = {
|
||||
test_table = true,
|
||||
},
|
||||
args = { "-count=1" },
|
||||
}),
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
vim.api.nvim_create_user_command("RunTest", function()
|
||||
neotest.run.run()
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command("RunTestFile", function()
|
||||
neotest.run.run(vim.fn.expand('%'))
|
||||
end, {})
|
||||
|
Reference in New Issue
Block a user