Skip to content

Commit

Permalink
doc: clarify the example for b:go_fmt_options
Browse files Browse the repository at this point in the history
  • Loading branch information
bhcleek committed Dec 7, 2019
1 parent e63b2cb commit be9535c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1343,9 +1343,12 @@ The dictionary version allows you to define options for multiple binaries:
*'b:go_fmt_options'*

This option is identical to |'g:go_fmt_options'|, but a buffer-level setting.
If present, it's used instead of the global setting. >
If present, it's used instead of the global setting. By default it is not set.

au BufRead,BufNewFile *.go let b:go_fmt_options = {
As an example, the following autocmd will configure goimports to put imports
of packages from the current module in their own group:
>
autocmd FileType go let b:go_fmt_options = {
\ 'goimports': '-local ' .
\ trim(system('{cd '. shellescape(expand('%:h')) .' && go list -m;}')),
\ }
Expand Down

0 comments on commit be9535c

Please sign in to comment.