Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add goField #854

Merged
merged 1 commit into from
Jun 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ To change it:
```vim
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_fields = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_operators = 1
Expand Down
8 changes: 7 additions & 1 deletion doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1096,9 +1096,15 @@ Highlights method names. By default it's disabled. >
<
*'g:go_highlight_structs'*

Highlights field names. By default it's disabled. >

let go:go_highlight_fields = 0
<
*'go:go_highlight_fields'*

Highlights struct names. By default it's disabled. >

let g:go_highlight_structs = 0
let g:go_highlight_structs = 0
<
*'g:go_highlight_interfaces'*

Expand Down
10 changes: 10 additions & 0 deletions syntax/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ if !exists("g:go_highlight_methods")
let g:go_highlight_methods = 0
endif

if !exists("go:go_highlight_fields")
let g:go_highlight_fields = 0
endif

if !exists("g:go_highlight_structs")
let g:go_highlight_structs = 0
endif
Expand Down Expand Up @@ -308,6 +312,12 @@ if g:go_highlight_methods != 0
endif
hi def link goMethod Type

" Fields;
if g:go_highlight_fields != 0
syn match goField /\(\.\)\@<=\a\+\([\ \n\r\:\)]\)\@=/
endif
hi def link goField Type

" Structs;
if g:go_highlight_structs != 0
syn match goStruct /\(.\)\@<=\w\+\({\)\@=/
Expand Down