aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-01 19:40:15 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-06-01 19:40:15 +0100
commita8aa55e04bc9d1f1be1b64bb1121ebd90e5b59b2 (patch)
tree4caa2af9ece09a572d589f0e6d5d5dc43d09949c
parentad01450025b239a1c9889e4d26c6178c84510fb7 (diff)
downloadpaludis-a8aa55e04bc9d1f1be1b64bb1121ebd90e5b59b2.tar.gz
paludis-a8aa55e04bc9d1f1be1b64bb1121ebd90e5b59b2.tar.xz
output.conf syntax
-rw-r--r--paludis/environments/paludis/default_output.conf2
-rw-r--r--vim/ftdetect/paludis.vim2
-rw-r--r--vim/syntax/Makefile.am1
-rw-r--r--vim/syntax/paludis-output-conf.vim76
4 files changed, 80 insertions, 1 deletions
diff --git a/paludis/environments/paludis/default_output.conf b/paludis/environments/paludis/default_output.conf
index cdd80ae..3fca061 100644
--- a/paludis/environments/paludis/default_output.conf
+++ b/paludis/environments/paludis/default_output.conf
@@ -1,4 +1,4 @@
-# vim: set tw=80 ft=conf et sw=4 sts=4 :
+# vim: set tw=80 ft=paludis-output-conf et sw=4 sts=4 :
# This is the default output configuration. In general, we show output to stdout
# where possible, we keep logs of messages, we keep logs of output only if a
diff --git a/vim/ftdetect/paludis.vim b/vim/ftdetect/paludis.vim
index 3db4bdd..7427b7d 100644
--- a/vim/ftdetect/paludis.vim
+++ b/vim/ftdetect/paludis.vim
@@ -80,3 +80,5 @@ au BufNewFile,BufRead **/repositories/*.conf
au BufNewFile,BufRead **/metadata/repository_mask.conf
\ set filetype=paludis-package-mask-conf
+au BufNewFile,BufRead output.conf
+ \ set filetype=paludis-output-conf
diff --git a/vim/syntax/Makefile.am b/vim/syntax/Makefile.am
index 22e2d94..54ce904 100644
--- a/vim/syntax/Makefile.am
+++ b/vim/syntax/Makefile.am
@@ -9,6 +9,7 @@ vimscripts = \
paludis-keywords-conf.vim \
paludis-licenses-conf.vim \
paludis-mirrors-conf.vim \
+ paludis-output-conf.vim \
paludis-package-mask-conf.vim \
paludis-repositories-conf.vim \
paludis-use-conf.vim
diff --git a/vim/syntax/paludis-output-conf.vim b/vim/syntax/paludis-output-conf.vim
new file mode 100644
index 0000000..4f00f48
--- /dev/null
+++ b/vim/syntax/paludis-output-conf.vim
@@ -0,0 +1,76 @@
+" Vim syntax file
+" Language: Paludis output.conf files
+" Author: Ciaran McCreesh
+" Copyright: Copyright (c) 2010 Ciaran McCreesh
+" Licence: You may redistribute this under the same terms as Vim itself
+"
+" Syntax highlighting for output.conf files.
+"
+
+if &compatible || v:version < 700
+ finish
+endif
+
+if exists("b:current_syntax")
+ finish
+endif
+
+syn region PaludisOutputConfComment start=/^\s*#/ end=/$/
+
+syn region PaludisOutputConfKey start=/^\(\s*[^#]\)\@=/ end=/=\@=/
+ \ contains=PaludisOutputConfKnownKey
+
+syn match PaludisOutputConfEquals /=/ skipwhite
+ \ nextgroup=PaludisOutputConfValue
+
+syn region PaludisOutputConfValue contained start=// end=/$/
+ \ contains=PaludisOutputConfString,PaludisOutputConfUnquoted,
+ \ PaludisOutputConfContinuation,PaludisOutputConfVariable,
+ \ PaludisOutputConfMacro,PaludisOutputConfKnownValue
+ \ skipwhite
+
+syn match PaludisOutputConfContinuation contained /\\$/
+ \ skipnl
+
+syn match PaludisOutputConfUnquoted contained /[^ \t$%"'\\]\+/ skipwhite
+
+syn region PaludisOutputConfString contained start=/"/ end=/"/
+ \ contains=PaludisOutputConfVariable,PaludisOutputConfMacro
+ \ skipwhite
+
+syn keyword PaludisOutputConfKnownKey contained
+ \ handler children messages_children type output_exclusivity
+ \ manager action ignore_unfetched if_success if_failure
+ \ child condition_variable if_true if_false if_unset
+ \ filename keep_on_empty keep_on_success summary_output_manager
+ \ format_debug format_info format_warn format_error format_log
+ \ summary_output_message
+
+syn keyword PaludisOutputConfKnownValue contained
+ \ buffer file format_messages forward_at_finish ipc tee standard
+
+syn match PaludisOutputConfVariable contained
+ \ /\$\({[^}]\+}\|[a-zA-Z0-9_]\+\)/ skipwhite
+
+syn match PaludisOutputConfMacro contained
+ \ /%\({[^}]*}\|[a-zA-Z0-9_]\*\)/ skipwhite
+
+syn region PaludisOutputConfSection start=/^\[/ end=/\]$/ skipwhite
+ \ contains=PaludisOutputConfSectionName
+
+syn keyword PaludisOutputConfSectionName contained
+ \ rule manager
+
+hi def link PaludisOutputConfKnownKey Keyword
+hi def link PaludisOutputConfKnownValue Special
+hi def link PaludisOutputConfString String
+hi def link PaludisOutputConfUnquoted Constant
+hi def link PaludisOutputConfVariable Identifier
+hi def link PaludisOutputConfMacro Macro
+hi def link PaludisOutputConfContinuation Preproc
+hi def link PaludisOutputConfComment Comment
+hi def link PaludisOutputConfSection Type
+hi def link PaludisOutputConfSectionName Special
+
+let b:current_syntax = "paludis-repositories-conf"
+