Skip to content

Commit

Permalink
config: default formatting and imports to gopls
Browse files Browse the repository at this point in the history
  • Loading branch information
bhcleek committed Mar 14, 2021
1 parent 95c79dc commit 79bf281
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions autoload/go/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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'*

Expand Down Expand Up @@ -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'*

Expand Down

0 comments on commit 79bf281

Please sign in to comment.