diff options
Diffstat (limited to 'syntax/go.vim')
-rw-r--r-- | syntax/go.vim | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/syntax/go.vim b/syntax/go.vim index 7b0fbaf5..e9634ba6 100644 --- a/syntax/go.vim +++ b/syntax/go.vim @@ -52,7 +52,7 @@ if !exists("g:go_highlight_trailing_whitespace_error") endif if !exists("g:go_highlight_operators") - let g:go_highlight_operators = 1 + let g:go_highlight_operators = 0 endif if !exists("g:go_highlight_functions") @@ -236,20 +236,18 @@ hi def link goTodo Todo " Operators; if g:go_highlight_operators != 0 - syn match goOperator /:=/ - syn match goOperator />=/ - syn match goOperator /<=/ - syn match goOperator /==/ - syn match goOperator /!=/ - syn match goOperator /+=/ - syn match goOperator /-=/ - syn match goOperator /\s>\s/ - syn match goOperator /\s<\s/ - syn match goOperator /\s+\s/ - syn match goOperator /\s-\s/ - syn match goOperator /\s\*\s/ - syn match goOperator /\s\/\s/ - syn match goOperator /\s%\s/ + " match single-char operators: - + % < > ! & | ^ * = + " and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= == + syn match goOperator /[-+%<>!&|^*=]=\?/ + " match / and /= + syn match goOperator /\/\%(=\|\ze[^/*]\)/ + " match two-char operators: << >> &^ + " and corresponding three-char operators: <<= >>= &^= + syn match goOperator /\%(<<\|>>\|&^\)=\?/ + " match remaining two-char operators: := && || <- ++ -- + syn match goOperator /:=\|||\|<-\|++\|--/ + " match ... + syn match goOperator /\.\.\./ endif hi def link goOperator Operator |