Skip to content
This repository was archived by the owner on Oct 11, 2018. It is now read-only.

Commit 03c839a

Browse files
committed
Update to reflect go_highlight_function_calls
With the elimination of go_highlight_methods and the addition of go_highlight_function_calls, the tutorial needs to be updated, as does the sample included vimrc file. As a newcomer to vim-go, it took me a few minutes to chase down why I thought the syntax highlighting was not working (and almost bailed back to vscode).
1 parent 38fb9b8 commit 03c839a

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

README.md

+21-3
Original file line numberDiff line numberDiff line change
@@ -848,16 +848,34 @@ If we add the following:
848848

849849
```vim
850850
let g:go_highlight_functions = 1
851-
let g:go_highlight_methods = 1
852851
```
853852

854-
We are now also highlighting function names. `Foo` and `main` will now
855-
be highlighted:
853+
We are now also highlighting function and method names in declarations. `Foo`
854+
and `main` will now be highlighted, but `Println` is not as that is an
855+
invocation:
856856

857857
```go
858858
func (t *T) Foo() {}
859859

860860
func main() {
861+
fmt.Println("vim-go")
862+
}
863+
```
864+
865+
If you also want to highlight function and method invocations, add the
866+
following:
867+
868+
```vim
869+
let g:go_highlight_function_calls = 1
870+
```
871+
872+
Now, `Println` will also be highlighted:
873+
874+
```go
875+
func (t *T) Foo() {}
876+
877+
func main() {
878+
fmt.Println("vim-go")
861879
}
862880
```
863881

vimrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ let g:go_list_type = "quickfix"
113113
let g:go_highlight_types = 1
114114
let g:go_highlight_fields = 1
115115
let g:go_highlight_functions = 1
116-
let g:go_highlight_methods = 1
116+
let g:go_highlight_function_calls = 1
117117
let g:go_highlight_extra_types = 1
118118
let g:go_highlight_generate_tags = 1
119119

0 commit comments

Comments
 (0)