aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpsyc://loupsycedyglgamf.onion/~lynX <BM-NB7xa9gEpmJgYp9PVnEdACiZcGmmEJcY>1984-04-04 00:44:06 +0000
committerpsyc://loupsycedyglgamf.onion/~lynX <BM-NB7xa9gEpmJgYp9PVnEdACiZcGmmEJcY>1984-04-04 00:44:06 +0000
commit06ecd72a6b10d9a21a58179ab7a9291dade46a50 (patch)
tree20e76cad4054478e786a1ee7cec050abd4a8d81b
parent38e778ea24de9e286a0149ed5888e0ea02915154 (diff)
downloadprep-06ecd72a6b10d9a21a58179ab7a9291dade46a50.tar.gz
prep-06ecd72a6b10d9a21a58179ab7a9291dade46a50.zip
full pht syntax: html + prep
-rw-r--r--share/vim/ftdetect/prep.vim7
-rw-r--r--share/vim/syntax/pht.vim10
-rw-r--r--share/vim/syntax/prep.vim57
3 files changed, 52 insertions, 22 deletions
diff --git a/share/vim/ftdetect/prep.vim b/share/vim/ftdetect/prep.vim
index 4092404..b3f5b97 100644
--- a/share/vim/ftdetect/prep.vim
+++ b/share/vim/ftdetect/prep.vim
@@ -1,4 +1,5 @@
1au BufRead,BufNewFile *.mlm set filetype=prep 1au BufRead,BufNewFile *.mlm set filetype=pht
2au BufRead,BufNewFile *.pml set filetype=pht
2au BufRead,BufNewFile *.prep set filetype=prep 3au BufRead,BufNewFile *.prep set filetype=prep
3au BufRead,BufNewFile *.pht set filetype=prep 4au BufRead,BufNewFile *.pht set filetype=pht
4au BufRead,BufNewFile *.pml set filetype=prep 5au BufRead,BufNewFile *.xht set filetype=pht
diff --git a/share/vim/syntax/pht.vim b/share/vim/syntax/pht.vim
new file mode 100644
index 0000000..4b9cd69
--- /dev/null
+++ b/share/vim/syntax/pht.vim
@@ -0,0 +1,10 @@
1" Vim syntax file
2" Language: PREP-processed HTML documents, since 1993
3" Maintainer: carlo von lynX
4" Latest Revision: 2016-08-25
5
6" This file specifically combines PREP with HTML syntax highlighting
7runtime! syntax/html.vim
8unlet b:current_syntax
9runtime! syntax/prep.vim
10
diff --git a/share/vim/syntax/prep.vim b/share/vim/syntax/prep.vim
index 9044267..d801602 100644
--- a/share/vim/syntax/prep.vim
+++ b/share/vim/syntax/prep.vim
@@ -1,27 +1,46 @@
1" Vim syntax file 1" Vim syntax file
2" Language: PREP as used by PHT, PML, ibiza and Multilingual Markup (MLM) 2" Language: PREP, the chilled multi-purpose preprocessor
3" as used with HTML (PHT), Multilingual Markup (MLM)
4" but also with apache config files and more.
5"
3" Maintainer: carlo von lynX 6" Maintainer: carlo von lynX
4" Latest Revision: 2016-08-25 7" Latest Revision: 2016-08-25
5 8
6" We may intentionally want to add upon HTML or other syntaxes! 9if exists("b:current_syntax")
7"if exists("b:current_syntax") 10 finish
8" finish 11endif
9"endif 12
10 13" some variants of pht support wiki-like linking syntaxes additionally
11syn match mlmInline /((([a-z_]\+.*)))/ 14" doesn't hurt to mark them up
12syn match mlmComment /^# .*$/ 15syn match prepWikiLink /\[http.\+\]/
13syn match mlmComment /^##.*$/ 16
14syn match mlmFlag /^[A-Z]\+)/ 17" the inline processing syntax of prep is pretty unique, it allows to
15syn match mlmStatement /^#[a-z_]\+/ 18" embed anything anywhere and it never ended up colliding with other
16syn match mlmFlagStatement /^[A-Z]\+)#[a-z_]\+/ 19" syntax
17 20syn match prepInline /((([a-z_]\+.*)))/
18hi def link mlmStatement PreProc 21
19hi def link mlmFlagStatement Statement 22" slightly tricky when # is both cpp-like preprocessor statement and
20hi def link mlmFlag Constant 23" comment character in all other cases
21hi def link mlmInline Identifier 24syn match prepStatement /^#[a-z_]\+/
25syn match prepComment /^# .*$/
26syn match prepComment /^##.*$/
27
28" rudimentary syntax, but the only bearable way to handle multilingual
29" content. have you looked at .PO or XLIFF? just terrible.
30syn match prepFlag /^[A-Z]\+)/
31
32" prep allows preprocessor statements depending on flags
33syn match prepFlagStatement /^[A-Z]\+)#[a-z_]\+/
34syn match prepFlagStatement /^[A-Z]\+)#[a-z_]\+/
35
36hi def link prepStatement PreProc
37hi def link prepFlagStatement Statement
38hi def link prepFlag Constant
39hi def link prepInline Identifier
22" should be Comment, but it is not being 40" should be Comment, but it is not being
23" shown differently from regular text!? 41" shown differently from regular text!?
24hi def link mlmComment Type 42hi def link prepComment Type
43hi def link prepWikilink Constant
25 44
26"let b:current_syntax = "prep" 45let b:current_syntax = "prep"
27 46