How to change the color of operators and methods in vim? -
recently i've been trying create own color scheme vim. i've been writing in-file, referencing vivify hi syntax calls , site rgb color codes. after changing of color scheme, , creating i'm happy with, noticed can't change color of operators (i.e. +, -, =, || etc.) or color of methods (e.g. object.method()
), both of these fall under keyword normal. being java programmer, , having used netbeans ide point, it's kind of tough not have differentiation between objects , methods. such hoping know of work-around, or way color such forms of syntax not changeable via pre-reserved keywords.
here's relevant color scheme:
create file $home/.vim/after/syntax/java.vim
with:
" highlight operators syntax match _operator "[-+&|<>=!\/~.,;:*%&^?()\[\]{}]" " highlight methods syntax match _paren "?=(" contains=cparen,ccppparen syntax match _memberfunc "\.\s*\w\+\s*(\@=" contains=_operator,_paren " colors hi _memberfunc guifg=#00ff00 guibg=none gui=none hi _operator guifg=#ff0000 guibg=none gui=none " resolve conflict comment markers syntax region _comment start="\/\*" end="\*\/" syntax match _comment "\/\/.*$" hi link _comment comment
Comments
Post a Comment