Sun, 25 Apr 2021 00:57:55 -0500
ok this format-on-write is more reliable
.vimrc | file | annotate | diff | comparison | revisions |
--- a/.vimrc +++ b/.vimrc @@ -370,11 +370,13 @@ augroup vim-lsp \ 'name': 'gopls', \ 'cmd': {server_info->['gopls']}, \ 'whitelist': ['go'], - \ 'workspace_config': {'gopls': - \ {'formatting.gofumpt': executable('gofumpt') ? v:true : v:false} - \ }, \}) - autocmd BufWritePre *.go LspDocumentFormatSync + endif + + if executable('gofumpt') + autocmd BufWritePre *.go :%!gofumpt + else + autocmd BufWritePre *.go :%!gofmt endif if executable('nimlsp')