ok this format-on-write is more reliable

Sun, 25 Apr 2021 00:57:55 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Sun, 25 Apr 2021 00:57:55 -0500
changeset 899
2315aad34ca3
parent 898
4bcbc5edab74
child 900
3e5c8dd15ebf

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')

mercurial