summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/scdoc.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 08:50:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 08:50:31 +0000
commitaed8ce9da277f5ecffe968b324f242c41c3b752a (patch)
treed2e538394cb7a8a7c42a4aac6ccf1a8e3256999b /runtime/syntax/scdoc.vim
parentInitial commit. (diff)
downloadvim-aed8ce9da277f5ecffe968b324f242c41c3b752a.tar.xz
vim-aed8ce9da277f5ecffe968b324f242c41c3b752a.zip
Adding upstream version 2:9.0.1378.upstream/2%9.0.1378upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'runtime/syntax/scdoc.vim')
-rw-r--r--runtime/syntax/scdoc.vim63
1 files changed, 63 insertions, 0 deletions
diff --git a/runtime/syntax/scdoc.vim b/runtime/syntax/scdoc.vim
new file mode 100644
index 0000000..0180f35
--- /dev/null
+++ b/runtime/syntax/scdoc.vim
@@ -0,0 +1,63 @@
+" Syntax file for scdoc files
+" Maintainer: Gregory Anders <contact@gpanders.com>
+" Last Updated: 2022-05-09
+" Upstream: https://github.com/gpanders/vim-scdoc
+
+if exists('b:current_syntax')
+ finish
+endif
+let b:current_syntax = 'scdoc'
+
+syntax match scdocFirstLineError "\%^.*$"
+syntax match scdocFirstLineValid "\%^\S\+(\d[0-9A-Za-z]*)\%(\s\+\"[^"]*\"\%(\s\+\"[^"]*\"\)\=\)\=$"
+
+syntax region scdocCommentError start="^;\S" end="$" keepend
+syntax region scdocComment start="^; " end="$" keepend
+
+syntax region scdocHeaderError start="^#\{3,}" end="$" keepend
+syntax region scdocHeader start="^#\{1,2}" end="$" keepend
+
+syntax match scdocIndentError "^[ ]\+"
+
+syntax match scdocLineBreak "++$"
+
+syntax region scdocOrderedListItem matchgroup=scdocOrderedListMarker start="^\z(\s*\)\." skip="^\z1 .*$" end="^" contains=scdocBold,scdocUnderline
+syntax region scdocListItem matchgroup=scdocListMarker start="^\z(\s*\)-" skip="^\z1 .*$" end="^" contains=scdocBold,scdocUnderline
+
+" Tables cannot start with a column
+syntax match scdocTableError "^:"
+
+syntax region scdocTable matchgroup=scdocTableEntry start="^[\[|\]][\[\-\]<=>]" end="^$" contains=scdocTableEntry,scdocTableError,scdocTableContinuation,scdocBold,scdocUnderline,scdocPre
+syntax match scdocTableError "^.*$" contained
+syntax match scdocTableContinuation "^ \+\S\+" contained
+syntax match scdocTableEntry "^[|:][\[\-\]<=> ]" contained
+syntax match scdocTableError "^[|:][\[\-\]<=> ]\S.*$" contained
+
+syntax region scdocBold concealends matchgroup=scdocBoldDelimiter start="\\\@<!\*" end="\\\@<!\*"
+syntax region scdocUnderline concealends matchgroup=scdocUnderlineDelimiter start="\<\\\@<!_" end="\\\@<!_\>"
+syntax region scdocPre matchgroup=scdocPreDelimiter start="^\t*```" end="^\t*```"
+
+syntax sync minlines=50
+
+hi default link scdocFirstLineValid Comment
+hi default link scdocComment Comment
+hi default link scdocHeader Title
+hi default link scdocOrderedListMarker Statement
+hi default link scdocListMarker scdocOrderedListMarker
+hi default link scdocLineBreak Special
+hi default link scdocTableSpecifier Statement
+hi default link scdocTableEntry Statement
+
+hi default link scdocFirstLineError Error
+hi default link scdocCommentError Error
+hi default link scdocHeaderError Error
+hi default link scdocIndentError Error
+hi default link scdocTableError Error
+hi default link scdocTableError Error
+
+hi default link scdocPreDelimiter Delimiter
+
+hi default scdocBold term=bold cterm=bold gui=bold
+hi default scdocUnderline term=underline cterm=underline gui=underline
+hi default link scdocBoldDelimiter scdocBold
+hi default link scdocUnderlineDelimiter scdocUnderline