annotate runtime/syntax/model.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 75c283beb74f
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: Model
32770
4027cefc2aab Farewell to Bram and dedicate upcoming Vim 9.1 to him (#12749)
Christian Brabandt <cb@256bit.org>
parents: 344
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: 344
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: 344
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 " very basic things only (based on the vgrindefs file).
32984
75c283beb74f re-sync with git
Christian Brabandt <cb@256bit.org>
parents: 32770
diff changeset
8 " If you use this language, please improve it, and send patches!
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
344
7033303ea0c0 updated for version 7.0089
vimboss
parents: 7
diff changeset
10 " Quit when a (custom) syntax file was already loaded
7033303ea0c0 updated for version 7.0089
vimboss
parents: 7
diff changeset
11 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " A bunch of keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 syn keyword modelKeyword abs and array boolean by case cdnl char copied dispose
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn keyword modelKeyword div do dynamic else elsif end entry external FALSE false
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn keyword modelKeyword fi file for formal fortran global if iff ift in integer include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn keyword modelKeyword inline is lbnd max min mod new NIL nil noresult not notin od of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn keyword modelKeyword or procedure public read readln readonly record recursive rem rep
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn keyword modelKeyword repeat res result return set space string subscript such then TRUE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn keyword modelKeyword true type ubnd union until varies while width
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " Special keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn keyword modelBlock beginproc endproc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " Comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn region modelComment start="\$" end="\$" end="$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " Strings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn region modelString start=+"+ end=+"+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " Character constant (is this right?)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match modelString "'."
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " Define the default highlighting.
344
7033303ea0c0 updated for version 7.0089
vimboss
parents: 7
diff changeset
37 " Only used when an item doesn't have highlighting yet
7033303ea0c0 updated for version 7.0089
vimboss
parents: 7
diff changeset
38 hi def link modelKeyword Statement
7033303ea0c0 updated for version 7.0089
vimboss
parents: 7
diff changeset
39 hi def link modelBlock PreProc
7033303ea0c0 updated for version 7.0089
vimboss
parents: 7
diff changeset
40 hi def link modelComment Comment
7033303ea0c0 updated for version 7.0089
vimboss
parents: 7
diff changeset
41 hi def link modelString String
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 let b:current_syntax = "model"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 " vim: ts=8 sw=2