diff options
author | cos <cos> | 2023-10-15 15:36:20 +0200 |
---|---|---|
committer | cos <cos> | 2023-10-15 15:36:23 +0200 |
commit | 143c3f99ae4270a64ee122989c1382122361bd19 (patch) | |
tree | 873219d59202bb0ff023b59c0c2d678722a8666c | |
parent | e266e8fd149040c89cdfa08c2f3a18c42637e802 (diff) | |
download | vim-preseed-143c3f99ae4270a64ee122989c1382122361bd19.zip |
Make plugin work better with 'compatible'
While breaking long lines is preferred to make text readable, the
existance of the line contination characters spewed red E10 errors when
testing the script in an environment without 'nocompatible' set.
-rw-r--r-- | syntax/preseed.vim | 43 |
1 files changed, 13 insertions, 30 deletions
diff --git a/syntax/preseed.vim b/syntax/preseed.vim index afc5326..d716866 100644 --- a/syntax/preseed.vim +++ b/syntax/preseed.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Debian preseed " Maintainer: cos <cos>, https://www.netizen.se/#contact -" Last Change: 2023 Oct 14 +" Last Change: 2023 Oct 15 " Remark: https://wiki.debian.org/DebianInstaller/Preseed " quit when a syntax file was already loaded @@ -15,12 +15,7 @@ endif " Create clusters for two of these four parts of a preseed line. syntax cluster preseedSecond contains=preseedQuestion,preseedOwnerLC -syntax cluster preseedThird contains=preseedBooleanType, - \ preseedStrLikeType, - \ preseedMultiSelType, - \ preseedNote, - \ preseedSelectType, - \ preseedQuestionLC +syntax cluster preseedThird contains=preseedBooleanType,preseedStrLikeType,preseedMultiSelType,preseedNote,preseedSelectType,preseedQuestionLC " Define the highlighting. Doesn't map perfectly to the group's intents, but @@ -59,48 +54,36 @@ hi! def link preseedStrLikeLC Operator " Add the syntax matching rules. " First, <owner> -sy match preseedOwner /^\s*[[:alnum:]_-]\+\(\s\|$\)/ - \ nextgroup=@preseedSecond,preseedOwnerLC +sy match preseedOwner /^\s*[[:alnum:]_-]\+\(\s\|$\)/ nextgroup=@preseedSecond,preseedOwnerLC " Second, <question name> -sy match preseedQuestion contained - \ "\s*\([[:alnum:]_-]\+/\)\+[[:alnum:]_-]\+\(\s\|$\)" - \ nextgroup=@preseedThird,preseedQuestionLC +sy match preseedQuestion contained "\s*\([[:alnum:]_-]\+/\)\+[[:alnum:]_-]\+\(\s\|$\)" nextgroup=@preseedThird,preseedQuestionLC " Third, <question type> " (boolean, multiselect, note, password, select, string) -sy match preseedBooleanType contained /\s*boolean\(\s\|$\)/ - \ nextgroup=preseedBooleanVal,preseedBooleanLC -sy match preseedMultiSelType contained /\s*multiselect\(\s\|$\)/ - \ nextgroup=preseedMultiSelVal,preseedMultiSelLC +sy match preseedBooleanType contained /\s*boolean\(\s\|$\)/ nextgroup=preseedBooleanVal,preseedBooleanLC +sy match preseedMultiSelType contained /\s*multiselect\(\s\|$\)/ nextgroup=preseedMultiSelVal,preseedMultiSelLC sy match preseedNote contained /\s*note$/ -sy match preseedSelectType contained /\s*select\(\s\|$\)/ - \ nextgroup=preseedSelectVal,preseedSelectLC -sy match preseedStrLikeType contained /\s*\(password\|string\)\(\s\|$\)/ - \ nextgroup=preseedStrLikeVal,preseedStrLikeLC +sy match preseedSelectType contained /\s*select\(\s\|$\)/ nextgroup=preseedSelectVal,preseedSelectLC +sy match preseedStrLikeType contained /\s*\(password\|string\)\(\s\|$\)/ nextgroup=preseedStrLikeVal,preseedStrLikeLC " Fourth, <value> sy match preseedBooleanVal contained /\s*\(false\|true\)/ -sy match preseedMultiSelVal contained /.*/me=e - \ contains=preseedMultiSelSep -sy match preseedMultiSelVal contained /.*\\/me=e-1 - \ contains=preseedMultiSelSep nextgroup=preseedMultiSelLC +sy match preseedMultiSelVal contained /.*/me=e contains=preseedMultiSelSep +sy match preseedMultiSelVal contained /.*\\/me=e-1 contains=preseedMultiSelSep nextgroup=preseedMultiSelLC sy match preseedMultiSelSep contained /,/ sy match preseedSelectVal contained /.*/ sy match preseedStrLikeVal contained /.*/me=e -sy match preseedStrLikeVal contained /.*\\/me=e-1 - \ nextgroup=preseedStrLikeLC +sy match preseedStrLikeVal contained /.*\\/me=e-1 nextgroup=preseedStrLikeLC " Line continuation needs to be down here override everything other syntax. -sy match preseedBooleanLC contained /\s*\\$/ - \ nextgroup=preseedBooleanVal,preseedBooleanLC skipnl +sy match preseedBooleanLC contained /\s*\\$/ nextgroup=preseedBooleanVal,preseedBooleanLC skipnl sy match preseedMultiSelLC contained /\\$/ nextgroup=preseedMultiSelVal skipnl sy match preseedOwnerLC contained /\s*\\$/ nextgroup=@preseedSecond skipnl sy match preseedQuestionLC contained /\s*\\$/ nextgroup=@preseedThird skipnl -sy match preseedSelectLC contained /\s*\\$/ - \ nextgroup=preseedSelectVal,preseedSelectLC skipnl +sy match preseedSelectLC contained /\s*\\$/ nextgroup=preseedSelectVal,preseedSelectLC skipnl sy match preseedStrLikeLC contained /\\$/ nextgroup=preseedStrLikeVal skipnl " And comments must override everything else. |