feat(nvim) improve the handling of the Go test runner

This commit is contained in:
Bruno Carlin 2022-03-30 10:41:13 +02:00
parent 6d433ace54
commit af2345b198

View file

@ -1,4 +1,4 @@
require('go').setup({ require('go').setup {
-- auto commands -- auto commands
auto_format = false, auto_format = false,
auto_lint = false, auto_lint = false,
@ -17,7 +17,7 @@ require('go').setup({
-- show test result with popup window -- show test result with popup window
test_popup = true, test_popup = true,
test_popup_width = 80, test_popup_width = 80,
test_popup_height = 10, test_popup_height = 15,
-- test open -- test open
test_open_cmd = 'edit', test_open_cmd = 'edit',
-- struct tags -- struct tags
@ -27,7 +27,7 @@ require('go').setup({
tags_flags = {'-skip-unexported'}, tags_flags = {'-skip-unexported'},
-- quick type -- quick type
quick_type_flags = {'--just-types'}, quick_type_flags = {'--just-types'},
}) }
vim.cmd [[ vim.cmd [[
augroup nvimgo_keymaps augroup nvimgo_keymaps
@ -37,5 +37,6 @@ vim.cmd [[
autocmd FileType go nnoremap <buffer><leader>tF :GoTestFile<cr> autocmd FileType go nnoremap <buffer><leader>tF :GoTestFile<cr>
autocmd FileType go nnoremap <buffer><leader>ta :GoTestAll<cr> autocmd FileType go nnoremap <buffer><leader>ta :GoTestAll<cr>
autocmd FileType go nnoremap <buffer><leader>a :GoToTest<cr> autocmd FileType go nnoremap <buffer><leader>a :GoToTest<cr>
autocmd User NvimGoTestPopupPost nnoremap <buffer><Esc> :q<cr>
augroup END augroup END
]] ]]