FEATURES:
delve
debugger. Use
:GoInstallBinaries
to install dlv
, and see :help go-debug
to get
started.
[GH-1390]IMPROVEMENTS:
gometalinter
is run automatically when saving a buffer. Whether the
location list or quickfix list is used can be customized in the usual ways.
[GH-1652]fe
-> fmt.Errorf()
snippet for NeoSnippet and UltiSnippets.
[GH-1677]BUG FIXES:
g:go_test_timeout
when running :GoTestFunc
.
[GH-1631]g:go_doc_url
variable wasn't working correctly in the
case when the "gogetdoc" command isn't installed.
[GH-1629]%[2]d
).
[GH-1634]g:go_test_show_name
change for :GoTest
when it changes during a
Vim session.
[GH-1641]g:go_test_show_name
value for :GoTest
failures if it's available.
[GH-1641]gometalinter
.
[GH-1648]gometalinter
is called in
autosave mode.
[GH-1654]'autowriteall'
the same as 'autowrite'
when determining whether to
write a buffer before calling some commands.
[GH-1653]BACKWARDS INCOMPATIBILITIES:
Highlighting function and method declarations/calls is fixed. To fix it we had to remove the meaning of the previous settings. The following setting is removed:
go_highlight_methods
in favor of the following settings and changes:
go_highlight_functions
: This highlights now all function and method
declarations (whereas previously it would also highlight function and
method calls, not anymore)go_highlight_function_calls
: This higlights now all all function and
method calls.
[GH-1557]g:go_metalinter_excludes
to g:go_metalinter_disabled
.
[GH-1648]:GoBuild
doesn't append the -i
flag anymore due the recent Go 1.10
changes that introduced a build cache.
[GH-1701]FEATURES:
g:go_doc_url
to change the godoc
server from godoc.org
to a custom
private instance. Currently only godoc -http
instances are supported.
[GH-1957].g:go_test_prepend_name
(off by default) to add the failing test
name to the output of :GoTest
[GH-1578].:GoDecls[Dir]
[GH-1604].IMPROVEMENTS:
:GoRename
is a bit smarter when automatically pre-filling values, and what
gets pre-filled can be configured with g:go_gorename_prefill
option.
In addition :GoRename <Tab>
now lists some common options.
[GH-1465].g:go_build_tags
to the :GoTest
family of functions.
[GH-1562].--tests
to gometalinter when autosaving and when a custom gometalinter
command has not been set.
[GH-1563].syntax sync fromstart
after :GoFmt
; this should make syntax
highlighting break slightly less often after formatting code
[GH-1582].:GoDescribe
doesn't require a scope anymore
[GH-1596].g:go_snippet_engine
now defaults to automatic
to use the first installed
snippet engine it can find.
[GH-1589].:GoFmt
end with .go
suffix as this
is required by some Go formatting tools
[GH-1601].BUG FIXES:
:GoTestCompile
produces a test binary again. The test binary will be
written to a temporary directory to avoid polluting the user's working
directory. [GH-1519]:GoSameIdsToggle
behavior when there were match groups
present, but none were goSameId.
[GH-1538]gpl
snippet for UltiSnips.
[GH-1535]:GoImpl
tab-completion would sometimes stop working
[GH-1581].g:go_highlight_function_arguments
to highlight function arguments.
[GH-1587].gocode
on MS-Windows.
[GH-1606].g:go_term_mode
values.
[GH-1611].BACKWARDS INCOMPATIBILITIES:
let g:go_version_warning = 0
to disable the warning.
[GH-1524].g:go_autodetect_gopath
is disabled by default, as support for vendor
has
been in Go for a while.g:go_autodetect_gopath
; instead of manually
setting it before every command it will now be set with the BufEnter
event,
and reset with the BufLeave
event. This means that $GOPATH
will be
changed for all commands run from Vim.
[GH-1461] and
[GH-1525].:GoFillStruct
to check the current line (vs. the exact cursor
position) for a struct literal to fill. To support this, fillstruct made
backwards imcompatible
changes.
[GH-1607].FEATURES:
:GoFillStruct
to fill a struct with all fields; uses
fillstruct
[GH-1443].IMPROVEMENTS:
:GoAddTags
and :GoRemoveTags
now continue to process if there are
malformed individual struct tags (run :GoUpdateBinaries
to update
gomodifiytags
binary) [GH-1401]:GoAddTags
and :GoRemoveTags
now shows a location list if there are
malformed struct tags (run :GoUpdateBinaries
to update gomodifiytags
binary) [GH-1401]:GoDef
sets the path of new buffers as relative to the current directory
when appropriate, instead of always using the full path [GH-1277].:GoDecls[Dir]
in unite.vim
[GH-1391].GoDecls[Dir]
.
[GH-1437].:GoImpl
[GH-1322].A new g:go_list_type_commands
setting is added to individually set the list type for each command [GH-1415]. As en example:
let g:go_list_type_commands = {"GoBuild": "quickfix", "GoTest": "locationlist"}
Show unexpected errors better by expanding newlines and tabs [GH-1456].
:GoInstallBinaries
and :GoUpdateBinaries
can now install/update only the
selected binaries (e.g. :GoUpdateBinaries guru golint
)
[GH-1467].
BUG FIXES:
:GoFmt
now (again) uses locationlist
to show formatting errors instead of
quickfix
. To change back to locationlist
you can change it with the
setting let g:go_list_type_commands = { "GoFmt": locationlist" }
[GH-1415]When using :GoImpl on type foo struct{} it would work, but with:
type foo struct{
}
or with a struct with fields, it would create the generated methods inside the struct [GH-1386]
:GoImpl
output would include extra newline, and error would include
trailing newline from shell command: vim-go: invalid receiver: "} *}"<00>
.
Fixed with [GH-1386]:GoMetaLinter
against the package of the open file [GH-1414].g:go_doc_command
and g:go_doc_options
to configure the command for
:GoDoc
were documented but never referenced [GH-1420].go#package#FromPath()
didn't work correctly [GH-1435].guru
based commands [GH-1439].gohtmltmpl
filetype now sources the html
ftplugin, so that matchit
,
completion, and some other things work better.
[GH-1442]:GoBuild
shell escaping [GH-1450].BACKWARDS INCOMPATIBILITIES:
:GoMetaLinter
now runs against the package of the open file instead of the
current working directory. This is so all commands behave the same relative
to the current open buffer. [GH-1414]
:GoImpl
now requires impl
version
3fb19c2c
or newer (released June 13, 2017); use :GoUpdateBinaries
to make
sure that you've got a recent version [GH-1322]
FEATURES:
set foldmethod=syntax
. Currently it folds blocks
({ }
), import
, var
, and const
blocks, and package-level comments.
These can be individually disabled/enabled if desired. For more info please
read the documentation for the g:go_fold_enable
setting. [GH-1339]
[GH-1377]:GoFiles
accepts now an argument to change the type of files it can show.
By default it shows.go source files
but now it can be changed to show
various kind of files. The full list can be seen via go list --help
under
the // Source Files
section [GH-1372] i.e::GoFiles CgoFiles // shows .go sources files that import "C"
:GoFiles TestGoFiles // shows _test.go files in package
:GoFiles IgnoredGoFiles // shows .go sources ignored due to build constraints
etc..
IMPROVEMENTS
_test.go
extension have a new template with a ready to
go test function. The template can be changed with the
g:go_template_test_file
setting. [GH-1318]go env
calls [GH-1320]:GoCoverage
can accept arguments now. i.e: :GoCoverage -run TestFoo
[GH-1326]:GoDecls
and :GoDeclsDir
shows a warning if ctrlp.vim is not installed:GoBuild
now compiles the package with the -i
flag added. This means that subsequent calls are much more faster due caching of packages [GH-1330]:GoCoverage
echos now the progress if g:go_echo_command_info
is enabled [GH-1333]g:go_doc_max_height
setting to control the maximum height of the window created by :GoDoc
and K
mapping [GH-1335]af
text object is able to include the assignment variable for anonymous functions. Can be disabled with g:go_textobj_include_variable = 0
[GH-1345]g:go_list_autoclose
setting to prevent closing the quickfix/location list after zero items [GH-1361]goimports
is used for autosave [GH-1367]BUG FIXES:
:GoTest
is called [GH-1327]:GoFmt
is called (either manually or via autosave) [GH-1362]:GoFmt
errors [GH-1365]GOPATH/src/github.com/foo/src/bar
) [GH-1366]gogetdoc
was not found [GH-1379]BACKWARDS INCOMPATIBILITIES:
:GoFmt
now uses quickfix
to show formatting errors instead of
locationlist
. To change back to locationlist
you can change it with the
setting let g:go_list_type = "locationlist"
[GH-1365]:GoLint
now runs against the package of the open file instead of the
current working directory. This is so all commands behave the same relative
to the current open buffer. For more info check the comment
here
[GH-1382]FEATURES:
:GoKeyify
command that turns unkeyed struct literals into keyed struct literals. [GH-1258]. i.e:Example{"foo", "bar", "qux"}
will be converted to:
Example{
foo: "foo",
bar: "bar",
qux: "qux",
}
Checkout the demo here: https://twitter.com/fatih/status/860410299714764802
g:go_addtags_transform
setting to change the transform rule (snakecase, camelcase, etc..) for :GoAddTags
command [GH-1275]ife
that expands to if err := foo(); err != nil { ... }
[GH-1268]IMPROVEMENTS
g:go_metalinter_excludes
option [GH-1253]<C-LeftMouse>
mapping so :GoDef
is used by default (as we do the same for CTRL-]
, gd
, etc. [GH-1264]go_list_type
setting in :GoFmt
and :GoImports
commands [GH-1304]go_list_type
setting in :GoMetaLinter
commands [GH-1309]go_fmt_options
can be now a dictionary to allow us to specifcy the
options for multiple binaries [GH-1308]. i.e: let g:go_fmt_options = {
\ 'gofmt': '-s',
\ 'goimports': '-local mycompany.com',
\ }
cygpath
is used for constructing the paths [GH-1092]BUG FIXES:
interface
and structs
words when go_highlight_types
is enabled [GH-1301]:GoRun
when used with neovim [GH-1296]:GoFmt
handles files that are symlinked into GOPATH better (note that this behaviour is discouraged, but we're trying our best to handle all edge case :)) [GH-1310]:GoTest
is able to parse error messages that include a colon :
[GH-1316]:GoTestCompile
under the hood doesn't produces a test binary anymore. Sometimes a race condition would happen which would not delete the test binary. [GH-1317]:GoDef
jumps now to definition for build tags defined with :GoBuildTags
(only guru) [GH-1319]BACKWARDS INCOMPATIBILITIES:
:GoLint
works on the whole directory instead of the current file. To use it for the current file give it as an argument, i.e :GoLint foo.go
[GH-1295]go_snippet_case_type
is removed in favor of the new go_addtags_transform
setting [GH-1299]go_imports_bin
is removed to avoid confusion as it would lead to race
conditions when set to gofmt
along with the usage of go_fmt_command
[GH-1212] [GH-1308]:GoTest
has been refactored for easy maintainability. If
you use any custom script that was using the function go#cmd#Test
, it
should be renamed to go#test#Test
FEATURES:
:GoAddTags
and :GoRemoveTags
command based on the tool
gomodifytags. This fixes many old
bugs that were due prior regexp based implementation. For the usage please
read the docs and checkout the demo at:
https://github.com/fatih/vim-go/pull/1204 [GH-1204]errl
snippet that expands to [GH-1185]:if err != nil {
log.Fatal(err)
}
:GoBuildTags
command to change build tags for tools such as guru
,
gorename
, etc ... There is also a new setting called g:go_build_tags
[GH-1232]IMPROVEMENTS:
<Leader>
in mappings examples for consistent documentation across the README [GH-1192]:GoAddTags
is now able to add options to existing tags with the syntax
:GoAddTags key,option
, i.e: :GoAddTags json,omitempty
[GH-985]BUG FIXES:
g:go_echo_command_info
when dispatching builds in neovim [GH-1176]:GoBuild
error in neovim due to invalid jobcontrol handler function
signatures (s:on_stdout
, s:on_stderr
)[GH-1176]go#jobcontrol#Spawn
command is executed [GH-1176]:
exist in GOPATH detection if initial GOPATH is not set [GH-1194]:GoAddTags
to allow modifying existing comments [GH-984]:GoAddTags
to work with nested structs [GH-990]:GoAddTags
adding tags twice for existing tags [GH-1064]:GoAddTags
not working for fields of types interface{}
[GH-1091]:GoAddTags
not working for fields with one line comments [GH-1181]:GoAddTags
not working if any field comment would contain {}
[GH-1189]:GoInstall
to accept additional arguments if async mode was enabled [GH-1246]BACKWARDS INCOMPATIBILITIES:
:GoGuruTags
is removed in favour of the new command
:GoBuildTags
. This command will be used now not just for guru
, also for
all new commands such as gorename
[GH-1232]g:go_guru_tags
is removed in favour of the new setting
g:go_build_tags
[GH-1232]FEATURES:
<name>_test.vim
will be automatically tested in for every Pull Request
(just like how we add tests to Go with _test.go
). Going forward this will
tremendously increase the stability and decrease the maintenance burden of
vim-go. [GH-1157]g:go_updatetime
setting to change the default updatetime (which was hardcoded previously) [GH-1055]g:go_template_use_pkg
setting to enable to use cwd as package name instead of basic template file [GH-1124]IMPROVEMENTS:
statusline
support for :GoMetaLinter
[GH-1120]7.4.2200
)[GH-1004]go env GOPATH
as well for :GoInstallBinaries
as Go has now a default path for GOPATH ("~/go")starting with 1.8 [GH-1152]:GoDocBrowser
now also works on import paths [GH-1174]BUG FIXES:
echom
to persist errors in case of multiple echos [GH-1122]:GoCoverage
[GH-1127]:GoCoverage
doesn't mess up custom syntax anymore [GH-1128]asm
files as they might be non Go ASM format [GH-1141]{{-
[GH-1143]guru
commands if custom build tags were set [GH-1136]:GoDef
failing for a modified buffer if hidden
was not set [GH-1132]:GoDefStack
to allow popping from jump list when buffer is modified [GH-1133]:GoMetaLinter
failing if go_metalinter_command
is set. [GH-1160]:GoMetaLinter
's go_metalinter_deadline
setting for async mode [GH-1146]BACKWARDS INCOMPATIBILITIES:
g:go_highlight_array_whitespace_error
g:go_highlight_chan_whitespace_error
g:go_highlight_extra_types
g:go_highlight_space_tab_error
g:go_highlight_trailing_whitespace_error
FEATURES:
Vim 8.0 support! This is the initial version to add Vim 8.0 based support to all basic commands (check out below for more information). With time we'll going to extend it to other commands. All the features are only enabled if you have at least Vim 8.0.0087. Backwards compatible with Vim 7.4.x. If you see any problems, please open an issue.
We have now a logo for vim-go! Thanks to @egonelbre for his work on this.
:GoBuild
, :GoTest
, :GoTestCompile
, :GoInstall
commands are now fully
async. Async means it doesn't block your UI anymore. If the command finished
it echoes the status. For a better experience use the statusline information
(more info below)
:GoCoverage
and :GoCoverageBrowser
commands are fully async.
:GoDef
is fully async if guru
is used as command.
:GoRename
is fully async .
:GoMetaLinter
is fully asnyc. Also works with the current autosave linting
feature. As a reminder, to enable auto linting on save either call
:GoMetaLinterAutoSaveToggle
(temporary) or add let
g:go_metalinter_autosave = 1
(persistent) to your virmc).
All guru
commands run asynchronously if Vim 8.0 is being used. Current
Commands:
:GoSameIds
also runs asynchronously. This makes it useful especially for
auto sameids mode. In this mode it constantly evaluates the identifier under the
cursor whenever it's in hold position and then calls :GoSameIds. As a
reminder, to enable auto info either call :GoSameIdsAutoToggle
(temporary)
or add let g:go_auto_sameids = 1
(persistent) to your vimrc.
:GoInfo
is now non blocking and works in async mode if guru
is used in
g:go_info_mode
. This makes it useful especially for autoinfo mode. In this
mode it constantly evaluates the identifier under the cursor whenever it's in
hold position and then calls :GoInfo. As a reminder, to enable auto info
either call :GoAutoTypeInfoToggle
(temporary) or add let
g:go_auto_type_info = 1
(persistent) to your vimrc. To use guru
instead of
gocode
add following to your vimrc: let g:go_info_mode = 'guru'
The guru
is more accurate and reliabed due the usage of guru
describe. It
doesn't rely on pkg/
folder like gocode
does. However it's slower than
gocode
as there is no caching mechanism in guru
yet.
go#statusline#Show()
which can be plugged into
the statusline bar. Works only with vim 8.0. It shows all asynchronously
called functions status real time. Checkout it in action:
https://twitter.com/fatih/status/800473735467847680. To enable it add the
following to your vimrc
. If you use lightline, airline, .. check out their
respective documentation on how to add a custom function:" go command status (requires vim-go)
set statusline+=%#goStatuslineColor#
set statusline+=%{go#statusline#Show()}
set statusline+=%*
IMPROVEMENTS:
g:go_highlight_functions
is enabled [GH-1048]let g:go_gocode_unimported_packages = 1
[GH-1084]/usr/local/Cellar/go/1.7.2/libexec
, more
info) . This is now
fixed by introducing automatic GOROOT set/unset before each tool invoke.
[GH-954]g:go_echo_go_info
to enable/disable printing identifier
information when completion is done [GH-1101]go_echo_command_info
setting is added, which is enabled by
default. It's just a switch for disabling messages of commands, such as
:GoBuild
, :GoTest
, etc.. Useful to disable if go#statusline#Show()
is
being used in Statusline, to prevent to see duplicates notifications.Search
, which is much more clear as
it changes according to the users colorscheme(go-lint)
for :GoLint [GH-1089]BUG FIXES:
:GoBuild
while using NeoVim [GH-1062]:GoDef
is used on a modified file [GH-1083]g:go_highlight_functions
is enabled [GH-1070]:GoSameIds
highlighting if a new buffer is opened in the same window [GH-1067]abort
to all vim function to return in case of errors [GH-1100]:GoCoverage
to be executed if working dir is not inside the test dir [GH-1033]BACKWARDS INCOMPATIBILITIES:
remove vim-dispatch and vimproc.vim support. vim 8.0 has now the necessary API to invoke async jobs and timers. Going forward we should use those. Also this will remove the burden to maintain compatibility with those plugins.
go#jobcontrol#Statusline()
is removed in favor of the new, global and
extensible go#statusline#Show()
IMPROVEMENTS:
-modified
flag, which allows us use guru on modified
buffers as well. This affects all commands where guru
is used. Such as
:GoDef
, :GoReferrers
, etc.. [GH-944]-modified
flag under the hood (for `gogetdoc), which allows us to get documentation for the identifier under the cursor ina modified buffer. [GH-1014]g:go_gocode_socket_type
setting to change the underlying socket type passed to gocode
. Useful to fallback to tcp
on cases such as Bash on Windows [GH-1000]:GoSameIds
is now automatically re-evaluated in cases of buffer reloads (such as :GoRename
) [GH-998]go_auto_sameids
[GH-1017]goimports
is being used [GH-1006]iota
and nil
are now highlighted correctly and are not treated as booleans [GH-1030]BUG FIXES:
GoCallers
for Windows user [GH-999]auto_sameids
feature as well [GH-1016]go_highlight_generate_tags
setting [GH-1023]:GoDef
is used [GH-1029]%%
) in strings [GH-1011]exepath
feature for the upcoming vim 8.0 release [GH-1046]BACKWARDS INCOMPATIBILITIES:
GoMetalinterAutoSaveToggle
to GoMetaLinterAutoSaveToggle
to make it compatible with the existing :GoMetaLinter
command [GH-1020]FEATURES:
:GoAddTags
command that adds field tags for the fields of a struct automatically based on the field names. Checkout the demo to see it in action: https://twitter.com/fatih/status/759822857773907968 [GH-971]json
is now much more smarter. It pre populates the placeholder according to the first word and it also applies snake_case
or camelCase
conversion. Together with :GoAddTags
it gives vim-go
users flexible ways of populating a field tag. Checkout the demo to see it in action: https://twitter.com/fatih/status/754477622042689536 [GH-927]:GoSameIds
command. When called highlights all same identifiers in the current file. Can be also enabled to highlight identifiers automatically (with :GoSameIdsAutoToggle
or g:go_auto_sameids
). Checkout the demo to see it in action: https://twitter.com/fatih/status/753673709278339072. [GH-936]:GoWhicherrs
command. It shows all possible values of the selected error variable. [GH-948]errp
snippet to expand an if err != nil { panic() }
clause [GH-926]let g:go_template_autocreate = 0
. You can use your own template with let g:go_template_file = "foo.go"
and putting the file under the templates/
folder. [GH-918]let g:go_auto_type_info = 1
enabled, you
can now easily enable/disable it on the fly. Support added with the following
commands: :GoAutoTypeInfoToggle
, :GoFmtAutoSaveToggle
,
:GoAsmFmtAutoSaveToggle
, :GoMetalinterAutoSaveToggle
,
:GoTemplateAutoCreateToggle
[GH-945]IMPROVEMENTS:
:GoDoc
accepts arguments now which are passed directly to godoc
. So usages like :GoDoc flag
works again (it was changed in previous versions [GH-894]:GoDef
works now for modified files as well [GH-910]--srcdir
flag to enable upcoming goimports
features [GH-957]GOPATH
for :GoInstall [GH-980]sh
and then resets it back to the user preference. [GH-967]:GoCoverage
highlight definition into go's syntax file for more customizability [GH-962]BUG FIXES:
#
characters when opening URL's, as it's handled as alternative file in vim [GH-895]doc/vim-go.txt
about usages of syntax highglightings [GH-897]:GoCoverage
not running for Neovim [GH-899]:GoFmt
not picking up -srcdir
if the command was set to use goimports
[GH-904]:GoTestCompile
to not leave behind artifacts if the cwd and the test files's directory do not match [GH-909]:GoDocBrowser
to not fail if godoc doesn't exist [GH-920]:GoFmt
to not change the permissions of saved file. Now original file permissions are restored [GH-922]BACKWARDS INCOMPATIBILITIES:
g:go_highlight_structs
and g:go_highlight_interface
are removed in favor of g:go_highlight_types
[GH-917]BUG FIXES:
syntax/go.vim
file from go:go_highlight_fields
to g:go_highlight_fields
FEATURES:
:GoImpl
command that generates method stubs for implementing an interface. Checkout the demo to see how it works. [GH-846]godef
support is added back as an optional setting. By default :GoDef
still uses guru
, but can be changed to godef
by adding the option: let g:go_def_mode = 'godef'
[GH-888]<C-w><C-]>
and <C-w>]>
shortcuts to split current window and jumpt to the identifier under cursor. [GH-838]g:go_highlight_fields
that highlights struct field references [GH-854]IMPROVEMENTS:
:GoRename
now reloads all files to reflect new changes automatically [GH-855]:GoTestCompile
does not create any temporary binary file anymore [GH-879]-tags
flag to :GoDef
. Now you can pass build tags to :GoDef
via :GoGuruTags
or g:go_guru_tags
system()
function that wraps both the standard system()
call and vimproc
. Now all system calls will take advantage and will use vimproc
if installed. [GH-801]gocode
's autobuild
and propose-builtins
flags automatically. With these settings packages will be automatically build to get the freshest completion candidates and builtin keywords will be showed as well. By defaults these settings are enabled. Settings can be disabled/enabled via g:go_gocode_autobuild
and g:go_gocode_propose_builtins
. [GH-815]http.HandlerFunc
snippets with hf
and hhf
shortcuts [GH-816]Example
and Benchmark
snippets with example
and benchmark
shortcuts [GH-836]GOBIN
and then in PATH
as most of vim-go users installs it to GOBIN
mostly [GH-823]guru
based commands by providing automatically detected GOPATHS, such as gb
, godep
to be used if possible [GH-861]<Plug>(go-imports)
mapping to make it assignable to other keys [GH-878]:GoInstallBinaries
for GOPATH's which don't have packages that work well with go get -u
. We have a new g:go_get_update
setting to disable it. By default it's enabled. [GH-883]BUG FIXES:
(go-freevars)
plug mapping to work as in visual mode instead of noncompatible normal mode [GH-832]:GoCoverage
accidentally enabling syntax highlighting for users who don't use syntax (i.e syntax off) [GH-827]:GoCoverage
colors to work for xterm as well [GH-863]:GoImplements
failing because of an empty scope definition. Now we default to current package to make it usable.:GoPlay
posting to non HTTPS url. [GH-847]:GoDef
completely for tcsh [GH-868]go test
related commands if no test files are available [GH-859]FEATURES:
CHANGELOG.md
file (which you're reading now). This will make it easier
for me to track changes and release versions:GoCoverage
is now highlighting the current source file for
covered/uncovered lines. If called again it runs the tests and updates the
annotation. Use :GoCoverageClear
to clear the coverage annotation.
This is a pretty good addition to vim-go and I suggest to check out the gif
that shows it in action: https://twitter.com/fatih/status/716722650383564800
[GH-786]:GoCoverageToggle
just like :GoCoverage
but acts as a toggle. If run
again it clears the annotation.:GoCoverageBrowser
opens a new annotated HTML page. This is the old
:GoCoverage
behavior [GH-786]:GoDoc
uses now gogetdoc to
lookup and display the comment documentation for the identifier under the
cursor. This is more superior as it support looking up dot imports, named
imports and imports where package name and file name are different [GH-782]guru support
: oracle
is replaced by the new tool guru
. oracle.vim
is therefore renamed to guru.vim
. I've also refactored the code to make it
much more easier to maintain and add additional features in future (such as
upcoming JSON decoding). vim-go is now fully compatible with guru
. Please
be sure you have installed guru
. You can easily do it with
:GoInstallBinaries
.:GoDef
uses now guru definition
under the hood instead of godef
.
This fixes the following issues: 1. dot imports 2. vendor imports 3. folder
!= package name imports. The tool godef
is also deprecated and not used
anymore.:GoDef
does have now history of the call stack. This means you can
easily jump back to your last entry. This can be done with the new command
:GoDefPop
or the mapping CTRL-t
. To see the stack and jump between entries
you can use the new command :GoDefStack
, which shows the list of all stack
entries. To reset the stack list anytime you can call :GoDefStackClear
[GH-776]IMPROVEMENTS:
:GoCoverage
is executed asynchronously when used within Neovim [GH-686]:GoTestFunc
supports now testable examples [GH-794]:GoDef
can jump to existing buffers instead of opening a new window
(split, vsplit or tab). By default it's disabled to not break the old
behavior, can be enabled with let g:go_def_reuse_buffer = 1
BUG FIXES:
go-run
mapping. It's for the whole main package,
not for the current fileBACKWARDS INCOMPATIBILITIES:
:GoDef
doesn't accept any identifier as an argument. This is not suported
via guru definition
and also was not widely used either. Also with this, we
significantly simplified the existing def.vim code:GoOracleScope
and :GoOracleTags
are deprecated in favor of
:GoGuruScope
and :GoGuruTags
. Also g:go_oracle_scope
is renamed to
g:go_guru_scope
g:go_guru_scope
accepts a variable in type of list
instead of string
.
i.g: let g:go_guru_scope = ["github.com/fatih/structs", "golang.org/x/tools/..."]
FEATURES:
]]
and [[
motions can be used to jump between functionsif
and af
are improved and implement from scratch. It has now
support for literal functions, comments of functions, better cursor
position support and more stable.:GoDecls
and :GoDeclsDir
commands that are available if
ctrlp.vim
is installed. Once called one can easily jump to any generic declaration available.:GoAlternate
command that toggles to the test
file of the current file. It also has new appropriate mappings to open the
alternate file in split or tabs. [GH-704]quickfix
or a location list
via the setting g:go_list_type
. Also all
the commands have now some sensible settings, some will open a qf window,
some will open a location list [GH-700]IMPROVEMENTS:
-srcdir
. Goimports now succesfully suports vendor/
folders with this release. [GH-735]g:go_gorename_prefill
setting which disabled pre filling the argument for :GoRename
[GH-711]:GoRun
to complete to filenames [GH-742]//go:generate
comment directives [GH-757]:GoInfo
automatic call [GH-759]BUG FIXES:
:GoErrCheck
checking abspath [GH-671]:GoInstall
correctly parsing errors [GH-692]:GoInstall
correctly parsing errors [GH-692]:GoTestFunc
for neovim [GH-695]:GoRun
accepting arguments for neovim [GH-730]go run
mappings not working [GH-542]FEATURES:
go
command.
This will be used in the future for all upcoming subcommands of the go
tool.:GoBuild
is now called asynchronously (it doesn't block the UI anymore).go#jobcontrol#Statusline()
can be used to plug into the statusline.
This will show the status of the job running asynchronously. The statusline
is improved to show the status per package instead of file. Assume you have
three files open, all belonging to the same package, if the package build
(:GoBuild
) is successful, all statusline's will be empty (means SUCCESS),
if it fails all files statusline's will show FAILED
.:GoRun
opens a new vertical terminal emulator inside Neovim and runs the
command there. The terminal mode can be changed with g:go_term_mode
,
which is by default vsplit
. Current options are vsplit, split or tab
.
We also have three new mappings to open :GoRun
command in different
terminal split modes: <Plug>(go-run-vertical)
, <Plug>(go-run-split)
and <Plug>(go-run-tab)
:GoTest
, :GoTestFunc
and :GoTestCompile
opens and runs in a new
terminal. The view mode (split,vertical, tab) is defined with
g:go_term_mode
. The g:go_term_enabled
setting can be use to change the
behavior of :GoTestXXX
commands .If set to 1
, it opens the test
commands inside a terminal, if not it runs them in background just like
:GoBuild
and displays the result in the statusline.g:go_term_height
and
g:go_term_width
. By default a vertical or horizontal view is equally
splitted by vim automatically. However with these settings we can for
example have a terminal with a smaller height when we split it
horizontally.go run
, go test
...) we
parse now the errors and list them inside a location list.location list
feature of
Vim. These are associated with each window independently of each other. This
enables us to have multiple, independent location lists per window (example
usages: :GoBuild
with errors that needs to be fixed, :GoLint
with
warnings that we want to check, :GoReferrers
with a list of referred
identifiers) [GH-626]:AsmFmt
command which is integrated to work with asmfmt [GH-673]IMPROVEMENTS:
:GoFmt
by checking if the binary is indeed installed on the system [GH-617]:GoMetaLinter
by adding the option to run the metalinter on save
and adding the option to limit the output to the currently active buffer. Set
let g:go_metalinter_autosave = 1
to enable autosave and use let
g:go_metalinter_autosave_enabled = ['vet', 'golint']
to change your options.
[GH-631]:GoDef
. If vimproc
is installed godef
will make use of it [GH-670]go_highlight_interfaces
[GH-681]BUG FIXES
:GoFmt
changing the fileformat of the current buffer [GH-615]:GoRename
to output the original error if parsing fails [GH-675]:GoTest
to output the original error if parsing fails [GH-676]fmt.Fprintln
not to highlight as builtin [GH-628]FEATURES:
:GoOracleTags
command was added to pass build tags to Oracle's -tags
flag. [GH-573]IMPROVEMENTS:
:GoTest
command to timeout after 10 seconds. Vim UI is blocking and
tests with large running times makes Vim blocking for a long time. This is
also customizable with the new option g:go_test_timeout
. [GH-578]:GoRename
to collect and populate quickfix window with errors.
[GH-577]:GoRun
by dropping bad filenames from quickfix window. This allows
us to have only valid entries which can be jumped to [GH-547]:GoMetaLinter
quickfix output by using absolute paths. This enables
us to jump to errors for all cases. [GH-565]:GoMetaLinter
command by adding a new option
g:go_metalinter_deadline
which cancels the linters after 5 seconds
(previous default). [GH-576]:GoMetaLinter
by jumping to the first encountered error from the quickfix window.// +buildfoo
, not
having an empty line between the package statement, etc..). Also add missing
GOARCH
values sucha s arm64
. There are many other useful improvements,
for more detail please have a look at
[GH-589]GOARCH
[GH-601]:GoUpdateBinaries
[GH-606]BUG FIXES:
:GoErrCheck
showing the correct output when executed inside the source folder [GH-564]:GoBuild
by not using /dev/null
anymore for build output (not
supported by go
). We pass a temporary file now. [GH-567]:GoFmt
passing g:go_fmt_options
options to goimports
. This option
is only valid with gofmt
. [GH-590]cygwin
users. [GH-575]make
will not highlighted but
make()
will be highlighted (gh-605)FEATURES:
:GoMetaLinter
command which invokes gometalinter. Please check the PR [GH-553] for more detail on customizing and usage of :GoMetaLinter
.IMPROVEMENTS:
:GoImport
to trim spaces when including import paths of form "fmt "
filetype
twice. Previously it was doing it twice, which was expensive/
characters, such as /home/user/go/
g:go_highlight_string_spellcheck
feature, which is enabled by feature. Now if spell is enabled, go strings are also checked.BUG FIXES:
:GoRun
to display errors when g:go_dispatch_enabled
was enabled:GoDrop
displaying "Not enough arguments" (regression):GoErrCheck
not showing PASS
message if the command was successful:GoErrCheck
not executing in the directory of the currently edited file:GoInstall
g:go_oracle_scope
when the scope was reseted. Previously it was set to empty string, which was causing false positives.With this release the version will now increase in minor
levels. So the next
release will be 1.2
, the other one 1.3
, etc.. This provides us more
flexibility (like releasing patch versions if needed).
FEATURES:
:GoGenerate
command is now available which can be used to invoke go generate
within vimIMPROVEMENTS:
GoRun, GoTest{,Func,Compile}, GoCoverage,
GoGenerate, GoErrcheck, GoLint, and GoVet
to handle multiple arguments.
Previously this feature was limited to only certain commands. What this means
is, for example :GoVet . -all
will invoke go tool vet . -all
automatically instead of plan go vet
. This is one of the big changes in
this release, so give it a try :):GoFmt
command, which now uses the -w
flag to
write to the source code directly, instead of outputting it to stdout. This
makes :GoFmt
much more faster than the current implementation. This is one
of the big changes in this release, so feedback is welcome!:GoImport
to have a !
feature. Now when when called
with a !
appended it will go get it. i.e: :GoImport!
github.com/fatih/color
. Useful if :GoImport
fails and you want to download
it.gb
vendored folders. Some commands should now work without any problem when invoked on a gb
project.-f
flag to :GoInstallBinaries command to support git url.<base>.insteadOf
configuration%s %5s %-5s %5.5f %.5f
:GoFreeVars
is calledBUG FIXES:
:GoDef
for files containing spaces. We know escape the files before passing to :GoDef
:GoFmt
not picking up the correct GOPATH when the fmt command was set to goimports
FEATURES:
:GoOracleScope
is added to change the oracle scope on-the-fly. It
accepts import paths as arguments. If no arguments are passed it prints the
current custom oracle scope. :GoOracleScope
also supports completion of
import paths, so it's very fast and handy to use. :GoOracleScope ""
clears
the current custom scope.:GoPath
command that displays the current GOPATH
. A path can be
passed to change the GOPATH
(i.e :GoPath ~/foo/src
). :GoPath ""
clears
and resets the GOPATH
to the initial value.godep
or is under a src
root directory which is not in
GOPATH
and changes/modifies the GOPATH
so all commands work based on this
GOPATH. What this means is, commands such as :GoDef
, :GoBuild
, etc.. will
include the Godeps folder. For example any go-to-definition via :GoDef
will
jump to the source code inside Godeps. This is enabled by default, but can
disabled with let g:go_autodetect_gopath = 0
. This new feature is also the
foundation for other tools such as gb
or wgo
.IMPROVEMENTS:
:GoFmt
(gofmt and goimports) speed. Now it's 2x faster than the previous implementation.:GoBuild
and :GoRun
. For more info about
dispatch see https://github.com/tpope/vim-dispatch . By default it's
disabled, to enable it add let g:go_dispatch_enabled = 1
to your vimrc.!
attribute for all go
tool commands. What this
does it, if :GoBuild
is called it will jump to the error. But :GoBuild!
will not jump to any error. This has the same behavior as the internal
:make
command in vim. We had this feature already for :GoBuild
and
:GoRun
. But not for :GoInstall
, :GoTest
, etc.. Now all commands are
unified.:GoInstall
.:GoInstall
, :GoTestXXX
functions and :GoVet
git url.<base>.insteadOf
and custom import paths of binaries. This
improves the commands :GoInstallBinaries
and :GoUpdateBinaries
.*.tmpl
extensions. Based on
the work from @cespare from https://github.com/cespare/vim-go-templatesBUG FIXES:
:GoErrCheck
is called:GoDoc
FEATURES:
:GoTestFunc
command (with appropriate
mappings) is added. Run tests function which surrounds the current cursor
location. Useful to test single tests.g:go_highlight_operators
to 1 in your vimrc.IMPROVEMENTS:
:GoDoc
usages to show a better error message:GoRename
to have a default value for rename input. Avoids retyping similar words.callgraph
is removed.BUG FIXES:
executeInDir
function which was failing when ignorelist was not set properly.:GoImport
:GoBuild
or :GoRun
FEATURES:
:GoTestCompile
command (with appropriate mappings) is added. Useful to compile a test binary or show/fix compile errors in quickfix windowIMPROVEMENTS:
referrer
mode is improved to show referring lines in the quickfix windowerrt
snippet is added, which expands to if err != nil { t.Fatal(err) }
errh
snippet is added, useful to be used in a http.Handler
Visual
mode. For example selecting a block and typing if
will create an if scope around the block.BUG FIXES:
var
and vars
snippetsgodef
, gocode
, etc...FEATURES:
IMPROVEMENTS:
BUG FIXES:
FEATURES:
IMPROVEMENTS:
csh
BUG FIXES:
We don't tag any changes or releases, so let's start with 1.0
. Our Windows
support is now in a good shape, tons of bugs are fixed, many new features and
improvements is being added and it's getting better with each day (thanks to
the community contributions).
Initial commit: https://github.com/fatih/vim-go/commit/78c5caa82c111c50e9c219f222d65b07694f8f5a