mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated vim plugins
This commit is contained in:
@ -333,7 +333,7 @@ CTRL-t
|
||||
putting it above a function call is going to show the full function
|
||||
signature. By default it uses `gocode` to get the type informations. To
|
||||
change the underlying tool from `gocode` to another tool, see
|
||||
|g:go_info_mode|.
|
||||
|'g:go_info_mode'|.
|
||||
|
||||
|
||||
*:GoInstall*
|
||||
@ -602,12 +602,12 @@ CTRL-t
|
||||
use the variable |'g:go_metalinter_command'|. To override the maximum
|
||||
linters execution time use |'g:go_metalinter_deadline'| variable.
|
||||
|
||||
*:GoBuildTags*
|
||||
*:GoBuildTags*
|
||||
:GoBuildTags [tags]
|
||||
|
||||
Changes the build tags for various commands. If you have any file that
|
||||
uses a custom build tag, such as `//+build integration` , this command can
|
||||
be used to pass it to all tools that accepts tags, such as guru, gorenate,
|
||||
be used to pass it to all tools that accepts tags, such as guru, gorename,
|
||||
etc..
|
||||
|
||||
The build tags is cleared (unset) if `""` is given. If no arguments is
|
||||
@ -690,7 +690,7 @@ CTRL-t
|
||||
:GoAddTags xml db
|
||||
<
|
||||
If [option] is passed it'll either add a new tag with an option or will
|
||||
modify exising tags. An example of adding `omitempty` to all `json` fields
|
||||
modify existing tags. An example of adding `omitempty` to all `json` fields
|
||||
would be:
|
||||
>
|
||||
:GoAddTags json,omitempty
|
||||
@ -833,7 +833,7 @@ Clears the coverage annotation
|
||||
*(go-coverage-toggle)*
|
||||
|
||||
Calls `go test -coverprofile-temp.out` for the current package and shows the
|
||||
coverage annotation. If run agains it acts as a toggle and clears the
|
||||
coverage annotation. If run again it acts as a toggle and clears the
|
||||
annotation.
|
||||
|
||||
*(go-imports)*
|
||||
@ -1014,7 +1014,7 @@ the package build (`:GoBuild`) is successful, all statusline's will show
|
||||
|
||||
To avoid always showing old status information, the status information is
|
||||
cleaned for each package after `60` seconds. This can be changed with the
|
||||
|g:go_statusline_duration| setting.
|
||||
|'g:go_statusline_duration'| setting.
|
||||
|
||||
*go#complete#GetInfo()*
|
||||
|
||||
@ -1107,10 +1107,23 @@ used >
|
||||
<
|
||||
*'g:go_fmt_options'*
|
||||
|
||||
Use this option to add additional options to the |'g:go_fmt_command'|. Default
|
||||
is empty. >
|
||||
|
||||
Use this option to add additional options to the |'g:go_fmt_command'|. It's
|
||||
value type can be either a string or a dictionary. This is due backwards
|
||||
compatibility. The string version will be removed in the future so please use
|
||||
the dictionary version. Default is empty.
|
||||
>
|
||||
let g:go_fmt_options = ''
|
||||
|
||||
or
|
||||
|
||||
let g:go_fmt_options = {}
|
||||
<
|
||||
The dictionary version allows you to define options for multiple binaries:
|
||||
>
|
||||
let g:go_fmt_options = {
|
||||
\ 'gofmt': '-s',
|
||||
\ 'goimports': '-local mycompany.com',
|
||||
\ }
|
||||
<
|
||||
*'g:go_fmt_fail_silently'*
|
||||
|
||||
@ -1130,12 +1143,20 @@ it's causing problems on some Vim versions. By default it's disabled. >
|
||||
<
|
||||
*'g:go_doc_keywordprg_enabled'*
|
||||
|
||||
Use this option to run `godoc` on words under the cursor with the default K ,
|
||||
keywordprg shortcut. Usually this shortcut is set to use the program `man`. In
|
||||
Go, using `godoc` is more idiomatic. Default is enabled. >
|
||||
Use this option to run `godoc` on words under the cursor with |K|; this will
|
||||
normally run the `man` program, but for Go using `godoc` is more idiomatic. It
|
||||
will not override the |'keywordprg'| setting, but will run |:GoDoc|. Default
|
||||
is enabled. >
|
||||
|
||||
let g:go_doc_keywordprg_enabled = 1
|
||||
<
|
||||
*'g:go_doc_height'*
|
||||
|
||||
Maximum height for the GoDoc window created with |:GoDoc|. Default is 20. >
|
||||
|
||||
let g:go_doc_max_height = 20
|
||||
<
|
||||
|
||||
*'g:go_def_mode'*
|
||||
|
||||
Use this option to define the command to be used for |:GoDef|. By default
|
||||
@ -1349,7 +1370,7 @@ default it's using `vet`, `golint` and `errcheck`.
|
||||
>
|
||||
let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck']
|
||||
<
|
||||
*'g:go_metalinter_excludes'*
|
||||
*'g:go_metalinter_excludes'*
|
||||
|
||||
Specifies the linters to be excluded from the |:GoMetaLinter| command. By
|
||||
default it's empty
|
||||
@ -1382,9 +1403,10 @@ explicitly overrides this behavior. For standard Vim behavior, set it to 10.
|
||||
<
|
||||
*'g:go_list_type'*
|
||||
|
||||
Specifies the type of list to use. The default value (empty) will use the
|
||||
appropriate kind of list for the command that was called. Supported values are
|
||||
"", "quickfix", and "locationlist". >
|
||||
Specifies the type of list to use for command outputs (such as errors from
|
||||
builds, results from static analysis commands, etc...). The default value
|
||||
(empty) will use the appropriate kind of list for the command that was called.
|
||||
Supported values are "", "quickfix", and "locationlist". >
|
||||
|
||||
let g:go_list_type = ""
|
||||
<
|
||||
@ -1453,10 +1475,10 @@ to an autocompletion proposals. By default it is enabled.
|
||||
>
|
||||
let g:go_gocode_propose_builtins = 1
|
||||
<
|
||||
*'g:go_gocode_unimported_packages'*
|
||||
*'g:go_gocode_unimported_packages'*
|
||||
|
||||
Specifies whether `gocode` should include suggestions from unimported packages.
|
||||
By default it is disabled.
|
||||
Specifies whether `gocode` should include suggestions from unimported
|
||||
packages. By default it is disabled.
|
||||
>
|
||||
let g:go_gocode_unimported_packages = 0
|
||||
<
|
||||
@ -1471,16 +1493,16 @@ Specifies whether `gocode` should use a different socket type. By default
|
||||
*'g:go_template_autocreate'*
|
||||
|
||||
When a new Go file is created, vim-go automatically fills the buffer content
|
||||
with a Go code template. By default the template under
|
||||
`templates/hello_world.go` is used. This can be changed with the
|
||||
|'g:go_template_file'| setting.
|
||||
with a Go code template. By default, the templates under the `templates`
|
||||
folder are used. This can be changed with the |'g:go_template_file'| and
|
||||
|'g:go_template_test_file'| settings.
|
||||
|
||||
If the new file is created in an already prepopulated package (with other Go
|
||||
files), in this case a Go code template with only the Go package declaration
|
||||
(which is automatically determined according to the current package) is added.
|
||||
|
||||
To always use the package name instead of the template, enable the
|
||||
|`g:go_template_use_pkg`| setting.
|
||||
|'g:go_template_use_pkg'| setting.
|
||||
|
||||
By default it is enabled.
|
||||
>
|
||||
@ -1493,12 +1515,20 @@ is created. Checkout |'g:go_template_autocreate'| for more info. By default
|
||||
the `hello_world.go` file is used.
|
||||
>
|
||||
let g:go_template_file = "hello_world.go"
|
||||
<
|
||||
*'g:go_template_test_file'*
|
||||
|
||||
Specifies the file under the `templates` folder that is used if a new Go test
|
||||
file is created. Checkout |'g:go_template_autocreate'| for more info. By
|
||||
default the `hello_world_test.go` file is used.
|
||||
>
|
||||
let g:go_template_test_file = "hello_world_test.go"
|
||||
<
|
||||
*'g:go_template_use_pkg'*
|
||||
|
||||
Specifies that, rather than using a template, the package name is used if a new
|
||||
Go file is created. Checkout |'g:go_template_autocreate'| for more info. By
|
||||
default the template file specified by |'g:go_template_file'| is used.
|
||||
Specifies that, rather than using a template, the package name is used if a
|
||||
new Go file is created. Checkout |'g:go_template_autocreate'| for more info.
|
||||
By default the template file specified by |'g:go_template_file'| is used.
|
||||
|
||||
>
|
||||
let g:go_template_use_pkg = 0
|
||||
@ -1511,7 +1541,7 @@ for |:GoDecls|. It is a Comma delimited list Possible options are:
|
||||
|
||||
let g:go_decls_includes = 'func,type'
|
||||
<
|
||||
*'g:go_echo_command_info'*
|
||||
*'g:go_echo_command_info'*
|
||||
|
||||
Echoes information about various Go commands, such as `:GoBuild`, `:GoTest`,
|
||||
`:GoCoverage`, etc... Useful to disable if you use the statusline integration,
|
||||
@ -1528,9 +1558,9 @@ default it's enabled >
|
||||
<
|
||||
Please note that 'noshowmode' must be set for this feature to work correctly.
|
||||
|
||||
*'g:go_statusline_duration'*
|
||||
*'g:go_statusline_duration'*
|
||||
|
||||
Specifices the duration of statusline information being showed per package. By
|
||||
Specifies the duration of statusline information being showed per package. By
|
||||
default it's 60 seconds. Must be in milliseconds.
|
||||
>
|
||||
let g:go_statusline_duration = 60000
|
||||
@ -1577,9 +1607,9 @@ You can locally test it by running:
|
||||
>
|
||||
make
|
||||
<
|
||||
This will run all tests and print either `PASS` or `FAIL` to indicate the final
|
||||
status of all tests. Additionally, each new pull request will trigger a new
|
||||
Travis-ci job.
|
||||
This will run all tests and print either `PASS` or `FAIL` to indicate the
|
||||
final status of all tests. Additionally, each new pull request will trigger a
|
||||
new Travis-ci job.
|
||||
|
||||
|
||||
==============================================================================
|
||||
@ -1635,7 +1665,13 @@ How do I use vim-go with syntastic?~
|
||||
Sometimes when using both `vim-go` and `syntastic` Vim will start lagging
|
||||
while saving and opening files. The following fixes this:
|
||||
>
|
||||
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
|
||||
let g:syntastic_go_checkers = ['golint', 'govet']
|
||||
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
|
||||
<
|
||||
If you want to add errcheck you can use gometalinter as a wrapper
|
||||
>
|
||||
let g:syntastic_go_checkers = ['golint', 'govet', 'gometalinter']
|
||||
let g:syntastic_go_gometalinter_args = ['--disable-all', '--enable=errcheck']
|
||||
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
|
||||
<
|
||||
Another issue with `vim-go` and `syntastic` is that the location list window
|
||||
@ -1649,9 +1685,9 @@ Using with NeoVim~
|
||||
|
||||
Note: Neovim currently is not a first class citizen for vim-go. You are free
|
||||
to open bug, however I'm not using Neovim so it's hard for me to test it.
|
||||
vim-go might not work well as good as in Vim. I'm happy to accept pull requests
|
||||
or very detailed bug reports. If you're interested to improve the state of
|
||||
Neovim in vim-go you're always welcome!
|
||||
vim-go might not work well as good as in Vim. I'm happy to accept pull
|
||||
requests or very detailed bug reports. If you're interested to improve the
|
||||
state of Neovim in vim-go you're always welcome!
|
||||
|
||||
Run `:GoRun` in a new tab, horizontal split or vertical split terminal
|
||||
>
|
||||
@ -1672,8 +1708,8 @@ by being a patreon at: https://www.patreon.com/fatih
|
||||
|
||||
By being a patron, you are enabling vim-go to grow and mature, helping me to
|
||||
invest in bug fixes, new documentation, and improving both current and future
|
||||
features. It's completely optional and is just a direct way to support Vim-go's
|
||||
ongoing development. Thanks!
|
||||
features. It's completely optional and is just a direct way to support
|
||||
Vim-go's ongoing development. Thanks!
|
||||
|
||||
Check it out: https://www.patreon.com/fatih
|
||||
|
||||
|
Reference in New Issue
Block a user