From 79bf281a764beb300d912aa6503c3d61fbd22d09 Mon Sep 17 00:00:00 2001 From: Billie Cleek Date: Thu, 27 Aug 2020 20:41:23 -0700 Subject: [PATCH] config: default formatting and imports to gopls --- autoload/go/config.vim | 8 ++++---- doc/vim-go.txt | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/autoload/go/config.vim b/autoload/go/config.vim index 2fc134fc79..552a9c573f 100644 --- a/autoload/go/config.vim +++ b/autoload/go/config.vim @@ -311,7 +311,7 @@ function! go#config#FmtAutosave() abort endfunction function! go#config#ImportsAutosave() abort - return get(g:, 'go_imports_autosave', 0) + return get(g:, 'go_imports_autosave', 1) endfunction function! go#config#SetFmtAutosave(value) abort @@ -355,11 +355,11 @@ function! go#config#DeclsMode() abort endfunction function! go#config#FmtCommand() abort - return get(g:, "go_fmt_command", "gofmt") + return get(g:, "go_fmt_command", 'gopls') endfunction function! go#config#ImportsMode() abort - return get(g:, "go_imports_mode", "goimports") + return get(g:, "go_imports_mode", 'gopls') endfunction function! go#config#FmtOptions() abort @@ -384,7 +384,7 @@ function! go#config#RenameCommand() abort endfunction function! go#config#GorenameBin() abort - return get(g:, "go_gorename_bin", "gopls") + return get(g:, "go_gorename_bin", 'gopls') endfunction function! go#config#GorenamePrefill() abort diff --git a/doc/vim-go.txt b/doc/vim-go.txt index 99c384d1b1..db050ca627 100644 --- a/doc/vim-go.txt +++ b/doc/vim-go.txt @@ -1350,10 +1350,10 @@ By default it's enabled > *'g:go_fmt_command'* Use this option to define which tool is used to format code. Valid options are -`gofmt`, `goimports`, and `gopls`. By default `gofmt` is used. +`gofmt`, `goimports`, and `gopls`. By default `gopls` is used. > - let g:go_fmt_command = "gofmt" + let g:go_fmt_command = 'gopls' < *'g:go_fmt_options'* @@ -1413,18 +1413,18 @@ it's causing problems on some Vim versions. This has no effect if Use this option to auto |:GoImports| on save. When both 'g:go_imports_autosave' and 'g:go_fmt_autosave' are enabled and both 'g:go_fmt_command' and 'g:go_imports_mode' are set to `goimports`, `goimports` -will be run only once. By default it's disabled. +will be run only once. By default it's enabled. > - let g:go_imports_autosave = 0 + let g:go_imports_autosave = 1 < *'g:go_imports_mode'* Use this option to define which tool is used to adjust imports. Valid options are `goimports` and `gopls`. The buffer will not be formatted when this is set -to `gopls`. By default `goimports` is used. +to `gopls`. By default `gopls` is used. > - let g:go_imports_mode = "goimports" + let g:go_imports_mode = 'gopls' < *'g:go_mod_fmt_autosave'*