aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-27 13:22:43 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-27 13:22:43 +0100
commit65ca72b275ab7a126c6a02148ae7f31c8fc3c01b (patch)
tree336c4fad02dc37956815ba1bbf926a780c5f2f0b
parent87a36cc419099f6141ef0f0fa31e51df994ae1a5 (diff)
downloadpaludis-65ca72b275ab7a126c6a02148ae7f31c8fc3c01b.tar.gz
paludis-65ca72b275ab7a126c6a02148ae7f31c8fc3c01b.tar.xz
Better syntax highlighting
-rw-r--r--vim/syntax/paludis-general-conf.vim10
-rw-r--r--vim/syntax/paludis-output-conf.vim10
-rw-r--r--vim/syntax/paludis-repositories-conf.vim10
3 files changed, 23 insertions, 7 deletions
diff --git a/vim/syntax/paludis-general-conf.vim b/vim/syntax/paludis-general-conf.vim
index 537f682..f8939b5 100644
--- a/vim/syntax/paludis-general-conf.vim
+++ b/vim/syntax/paludis-general-conf.vim
@@ -25,7 +25,8 @@ syn match PaludisGeneralConfEquals /=/ skipwhite
syn region PaludisGeneralConfValue contained start=// end=/$/
\ contains=PaludisGeneralConfString,PaludisGeneralConfUnquoted,
- \ PaludisGeneralConfContinuation,PaludisGeneralConfVariable
+ \ PaludisGeneralConfContinuation,PaludisGeneralConfVariable,
+ \ PaludisGeneralConfEnvVariable
\ skipwhite
syn match PaludisGeneralConfContinuation contained /\\$/
@@ -34,18 +35,21 @@ syn match PaludisGeneralConfContinuation contained /\\$/
syn match PaludisGeneralConfUnquoted contained /[^ \t$"'\\]\+/ skipwhite
syn region PaludisGeneralConfString contained start=/"/ end=/"/
- \ contains=PaludisGeneralConfVariable
+ \ contains=PaludisGeneralConfVariable,PaludisGeneralConfEnvVariable
\ skipwhite
syn keyword PaludisGeneralConfKnownKey contained
\ reduced_username portage_compatible distribution world
-syn match PaludisGeneralConfVariable contained /\$\({[^}]\+}\|[a-zA-Z0-9_]\+\)/ skipwhite
+syn match PaludisGeneralConfVariable contained /\$\({[^{}]\+}\|\(ENV{\)\@!=[a-zA-Z0-9_]\+\)/ skipwhite
+
+syn match PaludisGeneralConfEnvVariable contained /\$\({ENV{[^{}]\+}}\|ENV{[a-zA-Z0-9_]\+}\)/ skipwhite
hi def link PaludisGeneralConfKnownKey Keyword
hi def link PaludisGeneralConfString String
hi def link PaludisGeneralConfUnquoted Constant
hi def link PaludisGeneralConfVariable Identifier
+hi def link PaludisGeneralConfEnvVariable Statement
hi def link PaludisGeneralConfContinuation Preproc
hi def link PaludisGeneralConfComment Comment
diff --git a/vim/syntax/paludis-output-conf.vim b/vim/syntax/paludis-output-conf.vim
index 708792a..17bf1a6 100644
--- a/vim/syntax/paludis-output-conf.vim
+++ b/vim/syntax/paludis-output-conf.vim
@@ -26,6 +26,7 @@ syn match PaludisOutputConfEquals /?\?=/ skipwhite
syn region PaludisOutputConfValue contained start=// end=/$/
\ contains=PaludisOutputConfString,PaludisOutputConfUnquoted,
\ PaludisOutputConfContinuation,PaludisOutputConfVariable,
+ \ PaludisOutputConfEnvVariable,
\ PaludisOutputConfMacro,PaludisOutputConfKnownValue
\ skipwhite
@@ -35,7 +36,8 @@ syn match PaludisOutputConfContinuation contained /\\$/
syn match PaludisOutputConfUnquoted contained /[^ \t$%"'\\]\+/ skipwhite
syn region PaludisOutputConfString contained start=/"/ end=/"/
- \ contains=PaludisOutputConfVariable,PaludisOutputConfMacro
+ \ contains=PaludisOutputConfVariable,PaludisOutputConfMacro,
+ \ PaludisOutputConfEnvVariable
\ skipwhite
syn keyword PaludisOutputConfKnownKey contained
@@ -54,7 +56,10 @@ syn keyword PaludisOutputConfKnownValue contained
\ buffer file format_messages forward_at_finish ipc tee standard command
syn match PaludisOutputConfVariable contained
- \ /\$\({[^}]\+}\|[a-zA-Z0-9_]\+\)/ skipwhite
+ \ /\$\({[^{}]\+}\|\(ENV{\)\@![a-zA-Z0-9_]\+\)/ skipwhite
+
+syn match PaludisOutputConfEnvVariable contained
+ \ /\$\({ENV{[^{}]\+}}\|ENV{[a-zA-Z0-9_]\+}\)/ skipwhite
syn match PaludisOutputConfMacro contained
\ /%\({[^}]*}\|[a-zA-Z0-9_]\*\)/ skipwhite
@@ -70,6 +75,7 @@ hi def link PaludisOutputConfKnownValue Special
hi def link PaludisOutputConfString String
hi def link PaludisOutputConfUnquoted Constant
hi def link PaludisOutputConfVariable Identifier
+hi def link PaludisOutputConfEnvVariable Statement
hi def link PaludisOutputConfMacro Macro
hi def link PaludisOutputConfContinuation Preproc
hi def link PaludisOutputConfComment Comment
diff --git a/vim/syntax/paludis-repositories-conf.vim b/vim/syntax/paludis-repositories-conf.vim
index b628dc8..2c0c9c4 100644
--- a/vim/syntax/paludis-repositories-conf.vim
+++ b/vim/syntax/paludis-repositories-conf.vim
@@ -26,6 +26,7 @@ syn match PaludisRepositoriesConfEquals /=/ skipwhite
syn region PaludisRepositoriesConfValue contained start=// end=/$/
\ contains=PaludisRepositoriesConfString,PaludisRepositoriesConfUnquoted,
\ PaludisRepositoriesConfContinuation,PaludisRepositoriesConfVariable,
+ \ PaludisRepositoriesConfEnvVariable,
\ PaludisRepositoriesConfBadTemplateVariable,PaludisRepositoriesConfMacro,
\ PaludisRepositoriesConfBadMacro,PaludisRepositoriesConfKnownValue
\ skipwhite
@@ -36,7 +37,8 @@ syn match PaludisRepositoriesConfContinuation contained /\\$/
syn match PaludisRepositoriesConfUnquoted contained /[^ \t$%"'\\]\+/ skipwhite
syn region PaludisRepositoriesConfString contained start=/"/ end=/"/
- \ contains=PaludisRepositoriesConfVariable,PaludisRepositoriesConfBadTemplateVariable,
+ \ contains=PaludisRepositoriesConfVariable,PaludisRepositoriesConfEnvVariable,
+ \ PaludisRepositoriesConfBadTemplateVariable,
\ PaludisRepositoriesConfMacro,PaludisRepositoriesConfBadMacro
\ skipwhite
@@ -56,7 +58,10 @@ syn keyword PaludisRepositoriesConfKnownValue contained
\ use require ignore
syn match PaludisRepositoriesConfVariable contained
- \ /\$\({\(repository_template\)\@![^}]\+}\|\(repository_template\)\@![a-zA-Z0-9_]\+\)/ skipwhite
+ \ /\$\({\(repository_template\)\@![^{}]\+}\|\(repository_template\|ENV{\)\@![a-zA-Z0-9_]\+\)/ skipwhite
+
+syn match PaludisRepositoriesConfEnvVariable contained
+ \ /\$\({ENV{[^{}]\+}}\|ENV{[a-zA-Z0-9_]\+}\)/ skipwhite
syn match PaludisRepositoriesConfBadTemplateVariable contained
\ /\$\({repository_template[^}]*}\|repository_template[a-zA-Z0-9_]*\)/ skipwhite
@@ -73,6 +78,7 @@ hi def link PaludisRepositoriesConfKnownValue Keyword
hi def link PaludisRepositoriesConfString String
hi def link PaludisRepositoriesConfUnquoted Constant
hi def link PaludisRepositoriesConfVariable Identifier
+hi def link PaludisRepositoriesConfEnvVariable Statement
hi def link PaludisRepositoriesConfBadTemplateVariable Error
hi def link PaludisRepositoriesConfMacro Macro
hi def link PaludisRepositoriesConfBadMacro Error