Skip to content

Commit b785d64

Browse files
committed
update vim-go and tweak vimrc
1 parent b96dfd3 commit b785d64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+5378
-2315
lines changed

_vimrc

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
execute pathogen#infect('~\Projects\vim-config\plugins\{}')
22
cd ~\Projects
33

4+
let g:go_fmt_autosave = 0
5+
46
set nocompatible
57
" source $VIMRUNTIME/vimrc_example.vim
68
" source $VIMRUNTIME/mswin.vim
79
behave mswin
810

911
syntax on " turn syntax highlighting on
10-
colorscheme koehler " whee colors
12+
colorscheme desert " whee colors
1113
set gfn=consolas:h10.5 " set more readable font
1214

1315
" backspace and cursor keys wrap to previous/next line
@@ -27,6 +29,7 @@ set laststatus=2 " always show a status line
2729
set statusline=%<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
2830
" configure things to get ignored while loading files
2931
" let g:ctrlp_custom_ignore = '\v.*\.class|.*\\.git\\.*'
32+
let g:ctrlp_working_path_mode = 'rc'
3033
set wildignore+=*\\target\\*,**\.git\\*,*.class
3134

3235
" backspace in Visual mode deletes selection
@@ -58,6 +61,9 @@ noremap <C-t> :tabnew<Enter>
5861
noremap tt :tabnext<Enter>
5962
noremap TT :tabprev<Enter>
6063
64+
" Reclaim our :pop binding since <C-t> was used
65+
" nnoremap <C-[> <esc>:pop<cr>
66+
6167
" Buffer explorer
6268
let g:bufExplorerDefaultHelp=0 " Do not show default help.
6369
" change mapping to open
@@ -78,14 +84,12 @@ if has("autocmd")
7884

7985
augroup END
8086

81-
" add scala support
82-
au filetypedetect BufNewFile,BufRead *.scala setf scala
83-
84-
" json as javascript
85-
au filetypedetect BufNewFile,BufRead *.json setf javascript
86-
87-
" make stupid build system files parse as python
88-
au filetypedetect BufNewFile,BufRead *.sbs setf python
87+
au filetypedetect BufNewFile,BufRead *.scala setf scala " scala!
88+
au filetypedetect BufNewFile,BufRead *.json setf javascript " json as javascript
89+
au filetypedetect BufNewFile,BufRead *.sbs setf python " stupid build system files parse as python
90+
au filetypedetect BufNewFile,BufRead *.md setf markdown " md are markdown
91+
au filetypedetect BufNewFile,BufRead *.service setf sh " unit files as shell
92+
au filetypedetect BufNewFile,BufRead *.genny setf go " genny templates as go
8993
else
9094
set autoindent
9195
endif

plugins/local_rtp/ftplugin/go.vim

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nnoremap <f9> :GoFmt<enter>
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Thanks for improving vim-go! Before you dive in please read the following:
2+
3+
1. Please read our
4+
[FAQ](https://github.com/fatih/vim-go/wiki/FAQ-Troubleshooting), it might
5+
have answers for your problem
6+
2. If you add a new feature please don't forget to update the documentation:
7+
[doc/vim-go.txt](doc/vim-go.txt)
8+
3. If it's a breaking change or exceed +100 lines please open an issue first
9+
and describe the changes you want to make.
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
### Actual behavior
2+
3+
Write here what's happening ...
4+
5+
### Expected behavior
6+
7+
Write here what you're expecting ...
8+
9+
### Steps to reproduce:
10+
11+
Please create a reproducible case of your problem. Re produce it
12+
with a minimal `vimrc` with all plugins disabled and only `vim-go`
13+
enabled:
14+
15+
1.
16+
2.
17+
3.
18+
19+
### Configuration
20+
21+
Add here your current configuration and additional information that might be
22+
useful, such as:
23+
24+
* `vimrc` you used to reproduce
25+
* vim version:
26+
* vim-go version
27+
* go version
28+

plugins/vim-go/CHANGELOG.md

+142
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
## 1.8 (unplanned)
2+
3+
FEATURES:
4+
5+
* If you open a new buffer with a Go filename it get automatically populated based on the directory. If there are no Go files a simple main package is created, otherwise the file will include the package declaration line based on the package in the current directory. Checkout the demo to see it in action: https://twitter.com/fatih/status/748333086643994624. This is enabled by default. Can be disabled with `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]
6+
* The snippet expansion `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. Checkout the demo to see it in action: https://github.com/fatih/vim-go/pull/927 [gh-927]
7+
* Add new `errp` snippet to expand an `if err != nil { panic() }` clause [gh-926]
8+
9+
IMPROVEMENTS:
10+
* `: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]
11+
* `:GoDef` works now for modified files as well [gh-910]
12+
* Internal: fix indentations on all files to **2-spaces/no tabs**. This is now the default vim-go style across all VimL files [gh-915]
13+
* Syntax: improved syntax highglighting performance for methods, fields, structs and interface type declarations [gh-917]
14+
15+
BUG FIXES:
16+
17+
* Escape `#` characters when opening URL's, as it's handled as alternative file in vim [gh-895]
18+
* Fix typos in `doc/vim-go.txt` about usages of syntax highglightings [gh-897]
19+
* Fix `:GoCoverage` not running for Neovim [gh-899]
20+
* Fix `:GoFmt` not picking up `-srcdir` if the command was set to use `goimports` [gh-904]
21+
* Fix `:GoTestCompile` to not leave behind artifacts if the cwd and the test files's directory do not match [gh-909]
22+
* Fix `:GoDocBrowser` to not fail if godoc doesn't exist [gh-920]
23+
24+
BACKWARDS INCOMPATIBILITIES:
25+
26+
* `g:go_highlight_structs` and `g:go_highlight_interface` are removed in favor of `g:go_highlight_types` [gh-917]
27+
28+
29+
## 1.7.1 (June 7, 2016)
30+
31+
BUG FIXES:
32+
* Fixed typo in `syntax/go.vim` file from `go:go_highlight_fields` to `g:go_highlight_fields`
33+
34+
## 1.7 (June 7, 2016)
35+
36+
FEATURES:
37+
38+
* New **`:GoImpl`** command that generates method stubs for implementing an interface. Checkout the [demo](https://twitter.com/fatih/status/729991365581545472) to see how it works. [gh-846]
39+
* `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]
40+
* New `<C-w><C-]>` and `<C-w>]>` shortcuts to split current window and jumpt to the identifier under cursor. [gh-838]
41+
* New syntax setting" `g:go_highlight_fields` that highlights struct field references [gh-854]
42+
43+
IMPROVEMENTS:
44+
45+
* Invoking `:GoRename` now reloads all files to reflect new changes automatically [gh-855]
46+
* Calling `:GoTestCompile` does not create any temporary binary file anymore [gh-879]
47+
* Enable passing the `-tags` flag to `:GoDef`. Now you can pass build tags to `:GoDef` via `:GoGuruTags` or `g:go_guru_tags`
48+
* Internal refactoring to use custom `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]
49+
* Completion enables now `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]
50+
* Added new `http.HandlerFunc` snippets with `hf` and `hhf` shortcuts [gh-816]
51+
* Added new `Example` and `Benchmark` snippets with `example` and `benchmark` shortcuts [gh-836]
52+
* Search tool binaries first in `GOBIN` and then in `PATH` as most of vim-go users installs it to `GOBIN` mostly [gh-823]
53+
* Improve `guru` based commands by providing automatically detected GOPATHS, such as `gb`, `godep` to be used if possible [gh-861]
54+
* Add `<Plug>(go-imports)` mapping to make it assignable to other keys [gh-878]
55+
* Increase compatibility with tcsh [gh-869]
56+
* Improve `: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]
57+
58+
59+
60+
BUG FIXES:
61+
* Fix `(go-freevars)` plug mapping to work as in visual mode instead of noncompatible normal mode [gh-832]
62+
* Commands based on guru now shows a more meaningful error message instead of just showing the exit status (-1)
63+
* Fix `:GoCoverage` accidently enabling syntax highlighting for users who don't use syntax (i.e syntax off) [gh-827]
64+
* Fix `:GoCoverage` colors to work for xterm as well [gh-863]
65+
* Fix commenting out block of texts for Go templates (filetype gothtmltmpl) [gh-813]
66+
* Fix `:GoImplements` failing because of an empty scope definition. Now we default to current package to make it usable.
67+
* Fix `:GoPlay` posting to non HTTPS url. [gh-847]
68+
* Fix escaping the filenames for lint and motion commands [gh-862]
69+
* Fix escaping the filename to `:GoDef` completely for tcsh [gh-868]
70+
* Fix showing SUCCESS for `go test` related commands if no test files are available [gh-859]
71+
72+
73+
74+
## 1.6 (April 25, 2016)
75+
76+
FEATURES:
77+
78+
* New `CHANGELOG.md` file (which you're reading now). This will make it easier
79+
for me to track changes and release versions
80+
* **`:GoCoverage`** is now highlighting the current source file for
81+
covered/uncovered lines. If called again it runs the tests and updates the
82+
annotation. Use `:GoCoverageClear` to clear the coverage annotation.
83+
This is a pretty good addition to vim-go and I suggest to check out the gif
84+
that shows it in action: https://twitter.com/fatih/status/716722650383564800
85+
[gh-786]
86+
* **`:GoCoverageToggle`** just like `:GoCoverage` but acts as a toggle. If run
87+
again it clears the annotation.
88+
* **`:GoCoverageBrowser`** opens a new annotated HTML page. This is the old
89+
`:GoCoverage` behavior [gh-786]
90+
* **`:GoDoc`** uses now [gogetdoc](https://github.com/zmb3/gogetdoc) to
91+
lookup and display the comment documentation for the identifier under the
92+
cursor. This is more superior as it support looking up dot imports, named
93+
imports and imports where package name and file name are different [gh-782]
94+
* **`guru support`**: `oracle` is replaced by the new tool `guru`. `oracle.vim`
95+
is therefore renamed to `guru.vim`. I've also refactored the code to make it
96+
much more easier to maintain and add additional features in future (such as
97+
upcoming JSON decoding). vim-go is now fully compatible with `guru`. Please
98+
be sure you have installed `guru`. You can easily do it with
99+
`:GoInstallBinaries`.
100+
* **`:GoDef`** uses now `guru definition` under the hood instead of `godef`.
101+
This fixes the following issues: 1. dot imports 2. vendor imports 3. folder
102+
!= package name imports. The tool `godef` is also deprecated and not used
103+
anymore.
104+
* **`:GoDef`** does have now history of the call stack. This means you can
105+
easily jump back to your last entry. This can be done with the new command
106+
`:GoDefPop` or the mapping `CTRL-t`. To see the stack and jump between entries
107+
you can use the new command `:GoDefStack`, which shows the list of all stack
108+
entries. To reset the stack list anytime you can call `:GoDefStackClear`
109+
[gh-776]
110+
111+
IMPROVEMENTS:
112+
113+
* **`:GoCoverage`** is executed asynchronously when used within Neovim [gh-686]
114+
* **`:GoTestFunc`** supports now testable examples [gh-794]
115+
* **`:GoDef`** can jump to existing buffers instead of opening a new window
116+
(split, vsplit or tab). By default it's disabled to not break the old
117+
behavior, can be enabled with `let g:go_def_reuse_buffer = 1`
118+
119+
BUG FIXES:
120+
121+
* Fix not showing documentation for dot, named and package/file name being different imports [gh-332]
122+
* Term mode: fix closing location list if result is successful after a failed attempt [gh-768]
123+
* Syntax: fix gotexttmpl identifier highlighting [gh-778]
124+
* Doc: fix wrong wording for `go-run` mapping. It's for the whole main package,
125+
not for the current file
126+
127+
BACKWARDS INCOMPATIBILITIES:
128+
129+
* `:GoDef` doesn't accept any identifier as an argument. This is not suported
130+
via `guru definition` and also was not widely used either. Also with this, we
131+
significantly simplified the existing def.vim code
132+
* `:GoOracleScope` and `:GoOracleTags` are deprecated in favor of
133+
`:GoGuruScope` and `:GoGuruTags`. Also `g:go_oracle_scope` is renamed to
134+
`g:go_guru_scope`
135+
* `g:go_guru_scope` accepts a variable in type of `list` instead of `string`.
136+
i.g: `let g:go_guru_scope = ["github.com/fatih/structs", "golang.org/x/tools/..."]`
137+
138+
139+
## Previous releases
140+
141+
Previous changelogs can be found here: https://github.com/fatih/vim-go/releases
142+

0 commit comments

Comments
 (0)