vim-go v1.14 Release Notes
Release Date: 2017-08-06 // over 6 years ago-
๐ FEATURES:
- ๐ We now have folding support based on Go syntax. To enable it you have to set
the following Vim setting:
set foldmethod=syntax
. Currently it folds blocks ({ }
),import
,var
, andconst
blocks, and package-level comments. These can be individually disabled/enabled if desired. For more info please read the documentation for theg: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 viago 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
- โ
Files created with
_test.go
extension have a new template with a ready to go test function. The template can be changed with theg:go_template_test_file
setting. [GH-1318] - ๐ Improve performance for highly used operations by caching
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 ifg:go_echo_command_info
is enabled [GH-1333]- Add
g:go_doc_max_height
setting to control the maximum height of the window created by:GoDoc
andK
mapping [GH-1335] - The
af
text object is able to include the assignment variable for anonymous functions. Can be disabled withg:go_textobj_include_variable = 0
[GH-1345] - Add
g:go_list_autoclose
setting to prevent closing the quickfix/location list after zero items [GH-1361] - Cursor is now adjusted and locked to the correct line when
goimports
is used for autosave [GH-1367] - Complement the path of command for different situations of Cygwin environment [GH-1394]
- ๐ Show message when using :GoDef and opening a new buffer [GH-1385]
๐ BUG FIXES:
- ๐ Fix obtaining package's import path for the current directory. This fixes some issues we had if the user was using multiple GOPATH's [GH-1321]
- ๐ Fix documentation for vim-go & syntastic integration for errcheck using [GH-1323]
- ๐ Fix showing an output if a test has finished when
:GoTest
is called [GH-1327] - ๐ Fix warning when goimports doesn't support srcdir [GH-1344]
- Fix broken code folding with go_highlight_types [GH-1338]
- ๐ Fix blocking the ui when swapfile is enabled and
:GoFmt
is called (either manually or via autosave) [GH-1362] - ๐ Fix getting bin paths for binaries if GOPATH was not set and Go version =>1.7 was used [GH-1363]
- ๐ Fix picking up the correct list type for showing
:GoFmt
errors [GH-1365] - ๐ Fix auto detecting of GOPATH for import paths with string 'src' (i.e:
GOPATH/src/github.com/foo/src/bar
) [GH-1366] - ๐ Fix showing an empty window if
gogetdoc
was not found [GH-1379] - ๐ Fix commands not being executed if paths would include spaces (binary name, GOPATH, file itself, etc..) [GH-1374]
- ๐ Fix showing correct message when editing a new file [GH-1371]
- ๐ Fix filepaths in the quickfix list for :GoVet [GH-1381]
- ๐ Run :GoLint against the package of the open file [GH-1382]
BACKWARDS INCOMPATIBILITIES:
:GoFmt
now usesquickfix
to show formatting errors instead oflocationlist
. To change back tolocationlist
you can change it with the settinglet 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]
- ๐ We now have folding support based on Go syntax. To enable it you have to set
the following Vim setting: