Wednesday 15 January 2014

Making a Vim theme that disables highlighting except for some special keywords -



Making a Vim theme that disables highlighting except for some special keywords -

inspired several posts, your syntax highlighter wrong, coding in color , a case against syntax highlighting , others, decided making vim theme applied of these concepts idea.

the thing i'm not sure how.

from can tell, in order create vim theme need link color syntax identifier or name. , repeat hundreds or dozens of time in order have in lap theme.

like illustration linking color #ff0000 (red) , syntax identifier, or key, error. example. not sure if that's syntax key.

this work fine, except that, every syntax don't consider of import have define default foreground value.

and let's wanted add together new syntax keyword, i'd have ftsyntax , stuff (i believe) , filetype specific etc.

so first question is:

what best way give everything default foreground color , pick exceptions have colors?

and second, perhaps more of import question is:

how syntax highlight specific piece of text without having add together syntax rule? illustration have regex finds = , highlights them green, without having add together syntax rule specific that.

any help appreciated. of course of study if approach i'm taking not ideal or sucks open suggestions alternatives. give thanks you. :)

see illustration syntax file below:

syn keyword mykeywords of import keywords syn match myequals '=' hi link mykeywords special hi link myequals operator

this set we, are, important , keywords mykeywords syntax grouping , = myequals syntax group. specify how want highlight them, linking special , operator highlight groups.

see: :help group-name list of highlight groups , colors color-scheme.

in color-scheme, special reddish , operator green. default, else set default foreground color.

i saved ~/.vim/syntax/greduan.vim , tested :set syntax=greduan

vim syntax-highlighting

No comments:

Post a Comment