diff options
author | psyc://loupsycedyglgamf.onion/~lynX <BM-NB7xa9gEpmJgYp9PVnEdACiZcGmmEJcY> | 1984-04-04 00:44:06 +0000 |
---|---|---|
committer | psyc://loupsycedyglgamf.onion/~lynX <BM-NB7xa9gEpmJgYp9PVnEdACiZcGmmEJcY> | 1984-04-04 00:44:06 +0000 |
commit | 06ecd72a6b10d9a21a58179ab7a9291dade46a50 (patch) | |
tree | 20e76cad4054478e786a1ee7cec050abd4a8d81b | |
parent | 38e778ea24de9e286a0149ed5888e0ea02915154 (diff) | |
download | prep-06ecd72a6b10d9a21a58179ab7a9291dade46a50.tar.gz prep-06ecd72a6b10d9a21a58179ab7a9291dade46a50.zip |
full pht syntax: html + prep
-rw-r--r-- | share/vim/ftdetect/prep.vim | 7 | ||||
-rw-r--r-- | share/vim/syntax/pht.vim | 10 | ||||
-rw-r--r-- | share/vim/syntax/prep.vim | 57 |
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 @@ | |||
1 | au BufRead,BufNewFile *.mlm set filetype=prep | 1 | au BufRead,BufNewFile *.mlm set filetype=pht |
2 | au BufRead,BufNewFile *.pml set filetype=pht | ||
2 | au BufRead,BufNewFile *.prep set filetype=prep | 3 | au BufRead,BufNewFile *.prep set filetype=prep |
3 | au BufRead,BufNewFile *.pht set filetype=prep | 4 | au BufRead,BufNewFile *.pht set filetype=pht |
4 | au BufRead,BufNewFile *.pml set filetype=prep | 5 | au 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 | ||
7 | runtime! syntax/html.vim | ||
8 | unlet b:current_syntax | ||
9 | runtime! 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! | 9 | if exists("b:current_syntax") |
7 | "if exists("b:current_syntax") | 10 | finish |
8 | " finish | 11 | endif |
9 | "endif | 12 | |
10 | 13 | " some variants of pht support wiki-like linking syntaxes additionally | |
11 | syn match mlmInline /((([a-z_]\+.*)))/ | 14 | " doesn't hurt to mark them up |
12 | syn match mlmComment /^# .*$/ | 15 | syn match prepWikiLink /\[http.\+\]/ |
13 | syn match mlmComment /^##.*$/ | 16 | |
14 | syn match mlmFlag /^[A-Z]\+)/ | 17 | " the inline processing syntax of prep is pretty unique, it allows to |
15 | syn match mlmStatement /^#[a-z_]\+/ | 18 | " embed anything anywhere and it never ended up colliding with other |
16 | syn match mlmFlagStatement /^[A-Z]\+)#[a-z_]\+/ | 19 | " syntax |
17 | 20 | syn match prepInline /((([a-z_]\+.*)))/ | |
18 | hi def link mlmStatement PreProc | 21 | |
19 | hi def link mlmFlagStatement Statement | 22 | " slightly tricky when # is both cpp-like preprocessor statement and |
20 | hi def link mlmFlag Constant | 23 | " comment character in all other cases |
21 | hi def link mlmInline Identifier | 24 | syn match prepStatement /^#[a-z_]\+/ |
25 | syn match prepComment /^# .*$/ | ||
26 | syn 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. | ||
30 | syn match prepFlag /^[A-Z]\+)/ | ||
31 | |||
32 | " prep allows preprocessor statements depending on flags | ||
33 | syn match prepFlagStatement /^[A-Z]\+)#[a-z_]\+/ | ||
34 | syn match prepFlagStatement /^[A-Z]\+)#[a-z_]\+/ | ||
35 | |||
36 | hi def link prepStatement PreProc | ||
37 | hi def link prepFlagStatement Statement | ||
38 | hi def link prepFlag Constant | ||
39 | hi 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!? |
24 | hi def link mlmComment Type | 42 | hi def link prepComment Type |
43 | hi def link prepWikilink Constant | ||
25 | 44 | ||
26 | "let b:current_syntax = "prep" | 45 | let b:current_syntax = "prep" |
27 | 46 | ||