From 6ddfdc45c54163f43428d5f6471e5517859387c2 Mon Sep 17 00:00:00 2001 From: Laily Date: Sun, 11 Sep 2022 22:46:37 +0800 Subject: [PATCH] feat: add neotest --- nvim/lock.json | 2 +- nvim/lua/pluginconfig/init.lua | 1 + nvim/lua/pluginconfig/neotest.lua | 10 ++ nvim/lua/pluginconfig/which-key.lua | 194 ++++++++++++++-------------- nvim/lua/plugins.lua | 36 ++++-- 5 files changed, 136 insertions(+), 107 deletions(-) create mode 100644 nvim/lua/pluginconfig/neotest.lua diff --git a/nvim/lock.json b/nvim/lock.json index 2f3a8e4..5bc36b4 100644 --- a/nvim/lock.json +++ b/nvim/lock.json @@ -1 +1 @@ -{"nvim-toggleterm.lua": {"commit": "d2ceb2c"}, "nvim-dap": {"commit": "d9b315a"}, "FixCursorHold.nvim": {"commit": "5aa5ff1"}, "nvcode-color-schemes.vim": {"commit": "3a0e624"}, "telescope-fzf-native.nvim": {"commit": "65c0ee3"}, "glow.nvim": {"commit": "8dca358"}, "packer.nvim": {"commit": "6afb674"}, "nvim-lspconfig": {"commit": "8e65dbb"}, "nvim-spectre": {"commit": "345e5dd"}, "numb.nvim": {"commit": "453c50a"}, "nvim-treesitter": {"commit": "965a74f"}, "which-key.nvim": {"commit": "d1872f1"}, "telescope-file-browser.nvim": {"commit": "00a814a"}, "aerial.nvim": {"commit": "9ffdff2"}, "nvim-autopairs": {"commit": "5fe2441"}, "friendly-snippets": {"commit": "22a9975"}, "vim-vsnip": {"commit": "fd13f3f"}, "nvim-colorizer.lua": {"commit": "36c610a"}, "tabular": {"commit": "339091a"}, "rnvimr": {"commit": "4ced809"}, "gitsigns.nvim": {"commit": "4d8a6e0"}, "codi.vim": {"commit": "2898369"}, "nvim-ts-autotag": {"commit": "fdefe46"}, "telescope.nvim": {"commit": "2584ff3"}, "nvim-compe": {"commit": "d186d73"}, "telescope-project.nvim": {"commit": "b991a2a"}, "trouble.nvim": {"commit": "929315e"}, "nvim-ts-context-commentstring": {"commit": "4d3a68c"}, "lsp_signature.nvim": {"commit": "e65a638"}, "one-monokai-vim": {"commit": "4fdfd93"}, "gruvbox.nvim": {"commit": "c7aaa3e"}, "hop.nvim": {"commit": "75f73d3"}, "lush.nvim": {"commit": "6b9f399"}, "playground": {"commit": "bcfab84"}, "vim-go-coverage": {"commit": "d9b0c9f"}, "nvim-dap-ui": {"commit": "ebebd42"}, "popup.nvim": {"commit": "b7404d3"}, "nvim-web-devicons": {"commit": "2d02a56"}, "nvim-bqf": {"commit": "aac1ff9"}, "lua-dev.nvim": {"commit": "f3c72f2"}, "nvim-dap-virtual-text": {"commit": "2971ce3"}, "neotest": {"commit": "d20507c"}, "vim-matchup": {"commit": "9aa08cd"}, "barbar.nvim": {"commit": "c41ad6e"}, "monokai.nvim": {"commit": "4fc970e"}, "lspsaga.nvim": {"commit": "9ec569a"}, "vim-markdown": {"commit": "3a96439"}, "dashboard-nvim": {"commit": "d82ddae"}, "nvim-luapad": {"commit": "9815e26"}, "nvim-tree.lua": {"commit": "fb8735e"}, "bracey.vim": {"commit": "4e1a22a"}, "nvim-lsp-installer": {"commit": "ae913cb"}, "fzf-lua": {"commit": "f42fbf0"}, "lsp-rooter.nvim": {"commit": "7c83364"}, "nvim-comment": {"commit": "e9ac16a"}, "plenary.nvim": {"commit": "4b66054"}, "telescope-dap.nvim": {"commit": "b4134ff"}, "markdown-preview.nvim": {"commit": "02cc387"}, "DAPInstall.nvim": {"commit": "bbda2b0"}, "FTerm.nvim": {"commit": "efd1065"}, "galaxyline.nvim": {"commit": "eb81be0"}} +{"vim-go-coverage": {"commit": "d9b0c9f"}, "nvim-toggleterm.lua": {"commit": "d2ceb2c"}, "nvim-dap": {"commit": "d9b315a"}, "FixCursorHold.nvim": {"commit": "5aa5ff1"}, "nvcode-color-schemes.vim": {"commit": "3a0e624"}, "telescope-fzf-native.nvim": {"commit": "65c0ee3"}, "codi.vim": {"commit": "2898369"}, "packer.nvim": {"commit": "6afb674"}, "nvim-lspconfig": {"commit": "8e65dbb"}, "nvim-spectre": {"commit": "345e5dd"}, "numb.nvim": {"commit": "453c50a"}, "nvim-treesitter": {"commit": "965a74f"}, "which-key.nvim": {"commit": "d1872f1"}, "telescope-file-browser.nvim": {"commit": "00a814a"}, "aerial.nvim": {"commit": "9ffdff2"}, "nvim-autopairs": {"commit": "5fe2441"}, "friendly-snippets": {"commit": "22a9975"}, "neotest-go": {"commit": "d506f83"}, "nvim-colorizer.lua": {"commit": "36c610a"}, "tabular": {"commit": "339091a"}, "rnvimr": {"commit": "4ced809"}, "gitsigns.nvim": {"commit": "4d8a6e0"}, "glow.nvim": {"commit": "8dca358"}, "nvim-ts-autotag": {"commit": "fdefe46"}, "telescope.nvim": {"commit": "2584ff3"}, "nvim-compe": {"commit": "d186d73"}, "telescope-project.nvim": {"commit": "b991a2a"}, "trouble.nvim": {"commit": "929315e"}, "nvim-ts-context-commentstring": {"commit": "4d3a68c"}, "lsp_signature.nvim": {"commit": "e65a638"}, "one-monokai-vim": {"commit": "4fdfd93"}, "gruvbox.nvim": {"commit": "c7aaa3e"}, "dashboard-nvim": {"commit": "d82ddae"}, "lush.nvim": {"commit": "6b9f399"}, "playground": {"commit": "bcfab84"}, "nvim-bqf": {"commit": "aac1ff9"}, "nvim-dap-ui": {"commit": "ebebd42"}, "popup.nvim": {"commit": "b7404d3"}, "nvim-web-devicons": {"commit": "2d02a56"}, "FTerm.nvim": {"commit": "efd1065"}, "lua-dev.nvim": {"commit": "f3c72f2"}, "nvim-dap-virtual-text": {"commit": "2971ce3"}, "vim-vsnip": {"commit": "fd13f3f"}, "neotest": {"commit": "e682e44"}, "vim-matchup": {"commit": "9aa08cd"}, "fzf-lua": {"commit": "f42fbf0"}, "barbar.nvim": {"commit": "c41ad6e"}, "monokai.nvim": {"commit": "4fc970e"}, "lspsaga.nvim": {"commit": "9ec569a"}, "vim-markdown": {"commit": "3a96439"}, "hop.nvim": {"commit": "75f73d3"}, "nvim-luapad": {"commit": "9815e26"}, "nvim-tree.lua": {"commit": "fb8735e"}, "bracey.vim": {"commit": "4e1a22a"}, "nvim-lsp-installer": {"commit": "ae913cb"}, "lsp-rooter.nvim": {"commit": "7c83364"}, "nvim-comment": {"commit": "e9ac16a"}, "plenary.nvim": {"commit": "4b66054"}, "telescope-dap.nvim": {"commit": "b4134ff"}, "markdown-preview.nvim": {"commit": "02cc387"}, "DAPInstall.nvim": {"commit": "bbda2b0"}, "galaxyline.nvim": {"commit": "eb81be0"}} diff --git a/nvim/lua/pluginconfig/init.lua b/nvim/lua/pluginconfig/init.lua index 56bacba..aeac24a 100644 --- a/nvim/lua/pluginconfig/init.lua +++ b/nvim/lua/pluginconfig/init.lua @@ -7,6 +7,7 @@ require('pluginconfig/gitsigns') require('pluginconfig/hop') require('pluginconfig/lspinstall') require('pluginconfig/mkdx') +require('pluginconfig/neotest') require('pluginconfig/numb') require('pluginconfig/nvim-autopairs') require('pluginconfig/nvim-colorizer') diff --git a/nvim/lua/pluginconfig/neotest.lua b/nvim/lua/pluginconfig/neotest.lua new file mode 100644 index 0000000..08515e3 --- /dev/null +++ b/nvim/lua/pluginconfig/neotest.lua @@ -0,0 +1,10 @@ +require("neotest").setup({ + adapters = { + require("neotest-go")({ + experimental = { + test_table = true, + }, + args = { "-gcflags=all=-l", "-count=1", "-timeout=60s" } + }) + } +}) diff --git a/nvim/lua/pluginconfig/which-key.lua b/nvim/lua/pluginconfig/which-key.lua index 1f1dd94..ced47a7 100644 --- a/nvim/lua/pluginconfig/which-key.lua +++ b/nvim/lua/pluginconfig/which-key.lua @@ -22,15 +22,15 @@ require("which-key").setup { window = { border = "single", -- none, single, double, shadow position = "bottom", -- bottom, top - margin = {1, 0, 1, 0}, -- extra window margin [top, right, bottom, left] - padding = {2, 2, 2, 2} -- extra window padding [top, right, bottom, left] + margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left] + padding = { 2, 2, 2, 2 } -- extra window padding [top, right, bottom, left] }, layout = { - height = {min = 4, max = 25}, -- min and max height of the columns - width = {min = 20, max = 50}, -- min and max width of the columns + height = { min = 4, max = 25 }, -- min and max height of the columns + width = { min = 20, max = 50 }, -- min and max width of the columns spacing = 3 -- spacing between columns }, - hidden = {"", "", "", "", "call", "lua", "^:", "^ "}, -- hide mapping boilerplate + hidden = { "", "", "", "", "call", "lua", "^:", "^ " }, -- hide mapping boilerplate show_help = true -- show help message on the command line when the popup is visible } @@ -44,29 +44,29 @@ local opts = { } -- Set leader -vim.api.nvim_set_keymap('n', '', '', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('n', '', '', { noremap = true, silent = true }) vim.g.mapleader = ' ' -- no hl -vim.api.nvim_set_keymap('n', 'h', ':set hlsearch!', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('n', 'h', ':set hlsearch!', { noremap = true, silent = true }) -- explorer -vim.api.nvim_set_keymap('n', 'e', ':NvimTreeToggle', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('n', 'e', ':NvimTreeToggle', { noremap = true, silent = true }) -- telescope --vim.api.nvim_set_keymap('n', '', ":lua require 'telescope'.extensions.file_browser.file_browser()", {noremap = true, silent = true}) -- vim.api.nvim_set_keymap('n', '', ":lua require'telescope.builtin'.find_files()", {noremap = true, silent = true}) -vim.api.nvim_set_keymap('n', '', ":FzfLua files", {noremap = true, silent = true}) +vim.api.nvim_set_keymap('n', '', ":FzfLua files", { noremap = true, silent = true }) -- dashboard -vim.api.nvim_set_keymap('n', ';', ':Dashboard', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('n', ';', ':Dashboard', { noremap = true, silent = true }) -- Comments -vim.api.nvim_set_keymap("n", "b/", ":CommentToggle", {noremap = true, silent = true}) -vim.api.nvim_set_keymap("v", "b/", ":CommentToggle", {noremap = true, silent = true}) +vim.api.nvim_set_keymap("n", "b/", ":CommentToggle", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("v", "b/", ":CommentToggle", { noremap = true, silent = true }) -- close buffer -vim.api.nvim_set_keymap("n", "c", ":BufferClose", {noremap = true, silent = true}) +vim.api.nvim_set_keymap("n", "c", ":BufferClose", { noremap = true, silent = true }) -- open projects --vim.api.nvim_set_keymap('n', 'p', ":lua require'telescope'.extensions.project.project{}", {noremap = true, silent = true}) @@ -81,26 +81,26 @@ local mappings = { ["h"] = "No Highlight", a = { name = "+Action", - a = {"@:","execute last command again"} + a = { "@:", "execute last command again" } }, b = { name = "+Buffer", - n = {"BufferNext", "next buffer"}, - p = {"BufferPrevious", "previous buffer"}, - q = {"q", "quit"}, - s = {"w", "save"}, - r = {"e!", "reload"}, - d = {"BufferClose", "close buffer"}, - z = {"CommentToggle", "toggle comment"}, + n = { "BufferNext", "next buffer" }, + p = { "BufferPrevious", "previous buffer" }, + q = { "q", "quit" }, + s = { "w", "save" }, + r = { "e!", "reload" }, + d = { "BufferClose", "close buffer" }, + z = { "CommentToggle", "toggle comment" }, }, D = { name = "+Diagnostics", - t = {"TroubleToggle", "trouble"}, - w = {"TroubleToggle lsp_workspace_diagnostics", "workspace"}, - d = {"TroubleToggle lsp_document_diagnostics", "document"}, - q = {"TroubleToggle quickfix", "quickfix"}, - l = {"TroubleToggle loclist", "loclist"}, - r = {"TroubleToggle lsp_references", "references"}, + t = { "TroubleToggle", "trouble" }, + w = { "TroubleToggle lsp_workspace_diagnostics", "workspace" }, + d = { "TroubleToggle lsp_document_diagnostics", "document" }, + q = { "TroubleToggle quickfix", "quickfix" }, + l = { "TroubleToggle loclist", "loclist" }, + r = { "TroubleToggle lsp_references", "references" }, }, d = { name = "+Debug", @@ -110,33 +110,33 @@ local mappings = { -- o = {"DebugStepOver", "Step Over"}, -- r = {"DebugToggleRepl", "Toggle Repl"}, -- s = {"DebugStart", "Start"} - d = {"lua vim.lsp.diagnostic.show_line_diagnostics()", "show diagnostics"}, + d = { "lua vim.lsp.diagnostic.show_line_diagnostics()", "show diagnostics" }, - c = {"lua require'dap'.continue()", "continue"}, - b = {':lua require"dap".toggle_breakpoint()', "Toggle Breadpoint"}, - j = {':lua require"dap".step_over()', "step over"}, - k = {':lua require"dap".step_out()', "step out"}, - l = {':lua require"dap".step_into()',"step into"}, + c = { "lua require'dap'.continue()", "continue" }, + b = { ':lua require"dap".toggle_breakpoint()', "Toggle Breadpoint" }, + j = { ':lua require"dap".step_over()', "step over" }, + k = { ':lua require"dap".step_out()', "step out" }, + l = { ':lua require"dap".step_into()', "step into" }, --', ':lua require"dap".continue()') - u = {':lua require"dap".up()', "up"}, + u = { ':lua require"dap".up()', "up" }, -- d = {':lua require"dap".down()', "down"}, - _ = {':lua require"dap".disconnect();require"dap".stop();require"dap".run_last()', "disconnect"}, + _ = { ':lua require"dap".disconnect();require"dap".stop();require"dap".run_last()', "disconnect" }, --r = {':lua require"dap".repl.open({}, "vsplit")l', "repl open"}, - i = {':lua require"dap.ui.variables".visual_hover()',"visual_hover"}, + i = { ':lua require"dap.ui.variables".visual_hover()', "visual_hover" }, --? = {':lua require"dap.ui.variables".scopes()',"scopes"}, -- e = {':lua require"dap".set_exception_breakpoints({"all"})',"esception bp"}, -- a = {':lua require"debugHelper".attach()',"attach"}, -- A = {':lua require"debugHelper".attachToRemote()',"attach to remote"}, - s = {':lua local widgets=require"dap.ui.widgets";widgets.centered_float(widgets.scopes)',"centered_float"}, + s = { ':lua local widgets=require"dap.ui.widgets";widgets.centered_float(widgets.scopes)', "centered_float" }, }, f = { name = "+File", - m = {"lua require'utils'.open_md()", "open a markdown file in vscode"}, - s = {"w", "save file"}, - t = {"NvimTreeToggle", "toggle nvim tree"}, - r = {"RnvimrToggle", "toggle rnvimr"}, - y = {"lua require'utils'.yank_filepath()", "copy the file path"}, - l = {"NvimTreeFindFile", "find file"}, + m = { "lua require'utils'.open_md()", "open a markdown file in vscode" }, + s = { "w", "save file" }, + t = { "NvimTreeToggle", "toggle nvim tree" }, + r = { "RnvimrToggle", "toggle rnvimr" }, + y = { "lua require'utils'.yank_filepath()", "copy the file path" }, + l = { "NvimTreeFindFile", "find file" }, -- T = {"let @+ = 'go test -v -run='+expand('')", "get current word in go test"}, }, g = { @@ -149,46 +149,46 @@ local mappings = { R = { "lua require 'gitsigns'.reset_buffer()", "Reset Buffer" }, s = { "lua require 'gitsigns'.stage_hunk()", "Stage Hunk" }, u = { - "lua require 'gitsigns'.undo_stage_hunk()", - "Undo Stage Hunk", + "lua require 'gitsigns'.undo_stage_hunk()", + "Undo Stage Hunk", }, o = { "Telescope git_status", "Open changed file" }, b = { "Telescope git_branches", "Checkout branch" }, c = { "Telescope git_commits", "Checkout commit" }, C = { - "Telescope git_bcommits", - "Checkout commit(for current file)", + "Telescope git_bcommits", + "Checkout commit(for current file)", }, d = { - "Gitsigns diffthis HEAD", - "Git Diff", + "Gitsigns diffthis HEAD", + "Git Diff", }, }, l = { name = "+Language", - a = {"Lspsaga code_action", "Code Action"}, - A = {"Lspsaga range_code_action", "Selected Action"}, - d = {"Telescope lsp_document_diagnostics", "Document Diagnostics"}, - D = {"Telescope lsp_workspace_diagnostics", "Workspace Diagnostics"}, - f = {"LspFormatting", "Format"}, - F = {"Lspsaga lsp_finder", "LSP Finder"}, + a = { "Lspsaga code_action", "Code Action" }, + A = { "Lspsaga range_code_action", "Selected Action" }, + d = { "Telescope lsp_document_diagnostics", "Document Diagnostics" }, + D = { "Telescope lsp_workspace_diagnostics", "Workspace Diagnostics" }, + f = { "LspFormatting", "Format" }, + F = { "Lspsaga lsp_finder", "LSP Finder" }, -- i = {"Telescope lsp_implementations", "implement"}, - i = {"lua vim.lsp.buf.implementation()", "implement"}, - l = {"lua vim.lsp.buf.hover()", "hover"}, - L = {"Lspsaga show_line_diagnostics", "Line Diagnostics"}, - k = {": LspRestart", "restart lsp server"}, - n = {"lua vim.lsp.diagnostic.goto_next()", "next diagnostic"}, - p = {"lua vim.lsp.diagnostic.goto_prev()", "prev diagnostic"}, - P = {"Lspsaga preview_definition", "Preview Definition"}, - q = {"Telescope quickfix", "Quickfix"}, - r = {"lua vim.lsp.buf.references()", "references"}, - R = {"Lspsaga rename", "Rename"}, - t = {"LspTypeDefinition", "Type Definition"}, - x = {"cclose", "Close Quickfix"}, - s = {"Telescope lsp_document_symbols", "Document Symbols"}, - S = {"Telescope lsp_dynamic_workspace_symbols", "Workspace Symbols"}, - z = {"LspInfo", "Info"}, - [","]= {"LspInstallInfo","LSP servers"} + i = { "lua vim.lsp.buf.implementation()", "implement" }, + l = { "lua vim.lsp.buf.hover()", "hover" }, + L = { "Lspsaga show_line_diagnostics", "Line Diagnostics" }, + k = { ": LspRestart", "restart lsp server" }, + n = { "lua vim.lsp.diagnostic.goto_next()", "next diagnostic" }, + p = { "lua vim.lsp.diagnostic.goto_prev()", "prev diagnostic" }, + P = { "Lspsaga preview_definition", "Preview Definition" }, + q = { "Telescope quickfix", "Quickfix" }, + r = { "lua vim.lsp.buf.references()", "references" }, + R = { "Lspsaga rename", "Rename" }, + t = { "LspTypeDefinition", "Type Definition" }, + x = { "cclose", "Close Quickfix" }, + s = { "Telescope lsp_document_symbols", "Document Symbols" }, + S = { "Telescope lsp_dynamic_workspace_symbols", "Workspace Symbols" }, + z = { "LspInfo", "Info" }, + [","] = { "LspInstallInfo", "LSP servers" } }, p = { name = "Packer", @@ -197,48 +197,48 @@ local mappings = { s = { "PackerSync", "Sync" }, S = { "PackerStatus", "Status" }, u = { "PackerUpdate", "Update" }, - }, + }, q = { name = "quit", - q = {"qall", "quit"}, + q = { "qall", "quit" }, }, s = { name = "+Search", - b = {"Telescope git_branches", "Checkout branch"}, + b = { "Telescope git_branches", "Checkout branch" }, -- c = {"Telescope colorscheme", "Colorscheme"}, - c = {":nohl", "no highlight"}, - d = {"Telescope lsp_document_diagnostics", "Document Diagnostics"}, - D = {"Telescope lsp_workspace_diagnostics", "Workspace Diagnostics"}, - f = {"Fzflua files", "Find File"}, - m = {"Telescope marks", "Marks"}, - M = {"Telescope man_pages", "Man Pages"}, - r = {"FzfLua oldfiles", "Open Recent File"}, - R = {"Telescope registers", "Registers"}, - t = {"FzfLua live_grep", "Text"}, - ["#"] = {"FzfLua grep_cword", "Search word under cursor"}, + c = { ":nohl", "no highlight" }, + d = { "Telescope lsp_document_diagnostics", "Document Diagnostics" }, + D = { "Telescope lsp_workspace_diagnostics", "Workspace Diagnostics" }, + f = { "Fzflua files", "Find File" }, + m = { "Telescope marks", "Marks" }, + M = { "Telescope man_pages", "Man Pages" }, + r = { "FzfLua oldfiles", "Open Recent File" }, + R = { "Telescope registers", "Registers" }, + t = { "FzfLua live_grep", "Text" }, + ["#"] = { "FzfLua grep_cword", "Search word under cursor" }, }, S = { - name = "+Session", - s = {"SessionSave", "Save Session"}, - l = {"SessionLoad", "Load Session"}, + name = "+Session", + s = { "SessionSave", "Save Session" }, + l = { "SessionLoad", "Load Session" }, }, t = { name = "+Test", - a = {"TestSuite -v -cover", "TestSuite"}, - t = {"TestNearest -v -cover", "TestNearest"}, - f = {"TestFile -v -cover", "TestFile"}, - c = {"GoCover", "go coverage"}, - C = {"GoCoverClear", "go coverage clear"}, - b = {"lua require'dap'.toggle_breakpoint()", "set break point"}, - r = {"lua require'dap'.continue()", "continue"}, + a = { "TestSuite -v -cover", "TestSuite" }, + t = { "lua require('neotest').run.run() ", "TestNearest" }, + f = { "TestFile -v -cover", "TestFile" }, + c = { "GoCover", "go coverage" }, + C = { "GoCoverClear", "go coverage clear" }, + b = { "lua require'dap'.toggle_breakpoint()", "set break point" }, + r = { "lua require'dap'.continue()", "continue" }, }, -- extras z = { name = "+Zen", - s = {"TZBottom", "toggle status line"}, - t = {"TZTop", "toggle tab bar"}, - z = {"TZAtaraxis", "toggle zen"}, + s = { "TZBottom", "toggle status line" }, + t = { "TZTop", "toggle tab bar" }, + z = { "TZAtaraxis", "toggle zen" }, } } diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua index b4a9130..e0d399b 100644 --- a/nvim/lua/plugins.lua +++ b/nvim/lua/plugins.lua @@ -82,7 +82,7 @@ return require("packer").startup(function(use) use "kevinhwang91/rnvimr" -- use {'lukas-reineke/indent-blankline.nvim', opt=true, branch = 'lua'} - use { 'lewis6991/gitsigns.nvim',tag = 'release', opt = true, requires = { 'nvim-lua/plenary.nvim' } } + use { 'lewis6991/gitsigns.nvim', tag = 'release', opt = true, requires = { 'nvim-lua/plenary.nvim' } } use { "folke/which-key.nvim", opt = true } use { "ChristianChiarulli/dashboard-nvim", opt = true } use { "windwp/nvim-autopairs", opt = true } @@ -112,14 +112,32 @@ return require("packer").startup(function(use) --require_plugin("vimspector") -- vim test - use { - "nvim-neotest/neotest", - requires = { - "nvim-lua/plenary.nvim", - "nvim-treesitter/nvim-treesitter", - "antoinemadec/FixCursorHold.nvim" - } - } + use({ + "nvim-neotest/neotest", + requires = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "antoinemadec/FixCursorHold.nvim", + "nvim-neotest/neotest-go", + }, + config = function() + -- get neotest namespace (api call creates or returns namespace) + local neotest_ns = vim.api.nvim_create_namespace("neotest") + vim.diagnostic.config({ + virtual_text = { + format = function(diagnostic) + local message = diagnostic.message + :gsub("\n", " ") + :gsub("\t", " ") + :gsub("%s+", " ") + :gsub("^%s+", "") + return message + end, + }, + }, neotest_ns) + end + }) + use { "kyoh86/vim-go-coverage", opt = true, ft = "go" } require_plugin("vim-go-coverage") use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }