1
0
mirror of https://github.com/golang/go synced 2024-11-05 11:36:10 -07:00

gopls/doc: instructions for adding settings in coc.nvim

Change-Id: I7d69477cc103e8e45b0e9394e32945a0d8ee19b3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/200868
Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
Shengjing Zhu 2019-10-14 14:03:50 +08:00 committed by Ian Cottrell
parent 8de300cfc2
commit 5fa5b1782b

View File

@ -79,11 +79,16 @@ Use [coc.nvim], with the following `coc-settings.json` configuration:
"golang": { "golang": {
"command": "gopls", "command": "gopls",
"rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"], "rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"],
"filetypes": ["go"] "filetypes": ["go"],
"initializationOptions": {
"usePlaceholders": true
}
} }
} }
``` ```
Other [settings](settings.md) can be added in `initializationOptions` too.
The `editor.action.organizeImport` code action will auto-format code and add missing imports. To run this automatically on save, add the following line to your `init.vim`: The `editor.action.organizeImport` code action will auto-format code and add missing imports. To run this automatically on save, add the following line to your `init.vim`:
```vim ```vim