reinstate go format-on-write

Wed, 12 May 2021 22:46:20 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 12 May 2021 22:46:20 -0500
changeset 905
14c2238488ce
parent 904
a568d7cb564d
child 906
1e388dfbe200

reinstate go format-on-write

.vimrc file | annotate | diff | comparison | revisions
--- a/.vimrc
+++ b/.vimrc
@@ -368,13 +368,16 @@ augroup vim-lsp
       \ })
   endif
 
-  " GO111MODULE=off go get -u golang.org/x/tools/gopls mvdan.cc/gofumpt
+  " go install golang.org/x/tools/gopls@latest
+  " go install mvdan.cc/gofumpt@latest
   if executable('gopls')
     autocmd User lsp_setup call lsp#register_server({
       \ 'name': 'gopls',
       \ 'cmd': {server_info->['gopls']},
       \ 'whitelist': ['go'],
+      \ 'workspace_config': {'gopls': {'formatter.gofumpt': v:true}},
       \})
+    autocmd BufWritePre *.go LspDocumentFormatSync
   endif
 
   if executable('nimlsp')

mercurial