annotate runtime/syntax/aap.vim @ 33083:79b2eb83f2df v9.0.1827

patch 9.0.1827: xxd: no color support Commit: https://github.com/vim/vim/commit/e2528ae11134cdf35c312754b124aba4963d8054 Author: Aapo Rantalainen <aapo.rantalainen@gmail.com> Date: Thu Aug 31 17:58:13 2023 +0200 patch 9.0.1827: xxd: no color support Problem: xxd: no color support Solution: Add color support using xxd -R Add some basic color support for xxd The hex-value and value are both colored with the same color depending on the hex-value, e.g.: 0x00 = white 0xff = blue printable = green non-printable = red tabs and linebreaks = yellow Each character needs 11 more bytes to contain color. (Same color in a row could contain only one overhead but the logic how xxd creates colums must be then changed.) Size of colored output is increased by factor of ~6. Also grepping the output will break when colors is used. Flag for color is "-R", because less uses "-R". Color uses parameters auto,always,never same as less and grep (among others). E.g. xxd -R always $FILE | less -R Add some screen-tests (that currently on work on linux) to verify the feature works as expected. closes: #12131 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Aapo Rantalainen <aapo.rantalainen@gmail.com>
author Christian Brabandt <cb@256bit.org>
date Thu, 31 Aug 2023 18:15:03 +0200
parents 4027cefc2aab
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: A-A-P recipe
32770
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
3 " Maintainer: The Vim Project <https://github.com/vim/vim>
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
4 " Last Change: 2023 Aug 10
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
5 " Former Maintainer: Bram Moolenaar <Bram@vim.org>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 let s:cpo_save = &cpo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 set cpo&vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 syn include @aapPythonScript syntax/python.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn match aapVariable /$[-+?*="'\\!]*[a-zA-Z0-9_.]*/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn match aapVariable /$[-+?*="'\\!]*([a-zA-Z0-9_.]*)/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn keyword aapTodo contained TODO Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn match aapString +'[^']\{-}'+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn match aapString +"[^"]\{-}"+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn match aapCommand '^\s*:action\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match aapCommand '^\s*:add\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match aapCommand '^\s*:addall\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn match aapCommand '^\s*:asroot\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match aapCommand '^\s*:assertpkg\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match aapCommand '^\s*:attr\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match aapCommand '^\s*:attribute\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn match aapCommand '^\s*:autodepend\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn match aapCommand '^\s*:buildcheck\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn match aapCommand '^\s*:cd\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn match aapCommand '^\s*:chdir\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match aapCommand '^\s*:checkin\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match aapCommand '^\s*:checkout\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn match aapCommand '^\s*:child\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match aapCommand '^\s*:chmod\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn match aapCommand '^\s*:commit\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn match aapCommand '^\s*:commitall\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn match aapCommand '^\s*:conf\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn match aapCommand '^\s*:copy\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match aapCommand '^\s*:del\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn match aapCommand '^\s*:deldir\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn match aapCommand '^\s*:delete\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match aapCommand '^\s*:delrule\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match aapCommand '^\s*:dll\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match aapCommand '^\s*:do\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match aapCommand '^\s*:error\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match aapCommand '^\s*:execute\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn match aapCommand '^\s*:exit\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn match aapCommand '^\s*:export\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match aapCommand '^\s*:fetch\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match aapCommand '^\s*:fetchall\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match aapCommand '^\s*:filetype\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn match aapCommand '^\s*:finish\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn match aapCommand '^\s*:global\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn match aapCommand '^\s*:import\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn match aapCommand '^\s*:include\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn match aapCommand '^\s*:installpkg\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 syn match aapCommand '^\s*:lib\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 syn match aapCommand '^\s*:local\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match aapCommand '^\s*:log\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn match aapCommand '^\s*:ltlib\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn match aapCommand '^\s*:mkdir\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn match aapCommand '^\s*:mkdownload\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn match aapCommand '^\s*:move\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn match aapCommand '^\s*:pass\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 syn match aapCommand '^\s*:popdir\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 syn match aapCommand '^\s*:produce\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn match aapCommand '^\s*:program\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn match aapCommand '^\s*:progsearch\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn match aapCommand '^\s*:publish\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn match aapCommand '^\s*:publishall\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn match aapCommand '^\s*:pushdir\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 syn match aapCommand '^\s*:quit\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn match aapCommand '^\s*:recipe\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 syn match aapCommand '^\s*:refresh\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn match aapCommand '^\s*:remove\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn match aapCommand '^\s*:removeall\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn match aapCommand '^\s*:require\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn match aapCommand '^\s*:revise\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 syn match aapCommand '^\s*:reviseall\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 syn match aapCommand '^\s*:route\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 syn match aapCommand '^\s*:rule\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn match aapCommand '^\s*:start\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 syn match aapCommand '^\s*:symlink\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 syn match aapCommand '^\s*:sys\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn match aapCommand '^\s*:sysdepend\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 syn match aapCommand '^\s*:syspath\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn match aapCommand '^\s*:system\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn match aapCommand '^\s*:tag\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn match aapCommand '^\s*:tagall\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 syn match aapCommand '^\s*:toolsearch\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn match aapCommand '^\s*:totype\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn match aapCommand '^\s*:touch\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 syn match aapCommand '^\s*:tree\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn match aapCommand '^\s*:unlock\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 syn match aapCommand '^\s*:update\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 syn match aapCommand '^\s*:usetool\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 syn match aapCommand '^\s*:variant\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 syn match aapCommand '^\s*:verscont\>'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 syn match aapCommand '^\s*:print\>' nextgroup=aapPipeEnd
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 syn match aapPipeCmd '\s*:print\>' nextgroup=aapPipeEnd contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 syn match aapCommand '^\s*:cat\>' nextgroup=aapPipeEnd
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 syn match aapPipeCmd '\s*:cat\>' nextgroup=aapPipeEnd contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 syn match aapCommand '^\s*:syseval\>' nextgroup=aapPipeEnd
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 syn match aapPipeCmd '\s*:syseval\>' nextgroup=aapPipeEnd contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 syn match aapPipeCmd '\s*:assign\>' contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 syn match aapCommand '^\s*:eval\>' nextgroup=aapPipeEnd
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 syn match aapPipeCmd '\s*:eval\>' nextgroup=aapPipeEndPy contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 syn match aapPipeCmd '\s*:tee\>' nextgroup=aapPipeEnd contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 syn match aapPipeCmd '\s*:log\>' nextgroup=aapPipeEnd contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 syn match aapPipeEnd '[^|]*|' nextgroup=aapPipeCmd contained skipnl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 syn match aapPipeEndPy '[^|]*|' nextgroup=aapPipeCmd contained skipnl contains=@aapPythonScript
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 syn match aapPipeStart '^\s*|' nextgroup=aapPipeCmd
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 " A Python line starts with @. Can be continued with a trailing backslash.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 syn region aapPythonRegion start="\s*@" skip='\\$' end=+$+ contains=@aapPythonScript keepend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 " A Python block starts with ":python" and continues so long as the indent is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 " bigger.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124 syn region aapPythonRegion matchgroup=aapCommand start="\z(\s*\):python" skip='\n\z1\s\|\n\s*\n' end=+$+ contains=@aapPythonScript
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 " A Python expression is enclosed in backticks.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 syn region aapPythonRegion start="`" skip="``" end="`" contains=@aapPythonScript
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 " TODO: There is something wrong with line continuation.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130 syn match aapComment '#.*' contains=aapTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 syn match aapComment '#.*\(\\\n.*\)' contains=aapTodo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 syn match aapSpecial '$#'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 syn match aapSpecial '$\$'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135 syn match aapSpecial '$(.)'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 " A heredoc assignment.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 syn region aapHeredoc start="^\s*\k\+\s*$\=+\=?\=<<\s*\z(\S*\)"hs=e+1 end="^\s*\z1\s*$"he=s-1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140 " Syncing is needed for ":python" and "VAR << EOF". Don't use Python syncing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 syn sync clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 syn sync fromstart
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 " The default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145 hi def link aapTodo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 hi def link aapString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 hi def link aapComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 hi def link aapSpecial Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 hi def link aapVariable Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 hi def link aapPipeCmd aapCommand
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 hi def link aapCommand Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 hi def link aapHeredoc Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 let b:current_syntax = "aap"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 let &cpo = s:cpo_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157 unlet s:cpo_save
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 " vim: ts=8