annotate runtime/syntax/tilde.vim @ 34232:47385c831d92 v9.1.0061

patch 9.1.0061: UX of visual highlighting can be improved Commit: https://github.com/vim/vim/commit/e6d8b4662ddf9356da53f56e363b67b524fd8825 Author: Christian Brabandt <cb@256bit.org> Date: Sun Jan 28 23:33:29 2024 +0100 patch 9.1.0061: UX of visual highlighting can be improved Problem: UX of visual highlighting can be improved Solution: Improve readibility of visual highlighting, by setting better foreground and background colors The default visual highlighting currently is nice in that it overlays the actual syntax highlighting by using a separate distinct background color. However, this can cause hard to read text, because the contrast between the actual syntax element and the background color is way too low. That is an issue, that has been bothering colorschemes authors for quite some time so much, that they are defining the Visual highlighting group to use a separate foreground and background color, so that the syntax highlighting vanishes, but the text remains readable (ref: vim/colorschemes#250) So this is an attempt to perform the same fix for the default Visual highlighting and just use a default foreground and background color instead of using reverse. I also removed the hard-coded changes to the Visual highlighting in init_highlight. It's not quite clear to me, why those were there and not added directly to the highlighting_init_<dark|light> struct. closes: #13663 related: vim/colorschemes#250 Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Sun, 28 Jan 2024 23:39:23 +0100
parents 5b7ea82bc18f
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 " This file works only for Vim6.x
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Language: Tilde
22723
5b7ea82bc18f Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 2034
diff changeset
4 " Maintainer: Tobias Rundström <tobi@tildesoftware.net>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " URL: http://www.tildesoftware.net
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 7
diff changeset
6 " CVS: $Id: tilde.vim,v 1.1 2004/06/13 19:31:51 vimboss Exp $
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
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 "tilde dosent care ...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 syn match tildeFunction "\~[a-z_0-9]\+"ms=s+1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 syn region tildeParen start="(" end=")" contains=tildeString,tildeNumber,tildeVariable,tildeField,tildeSymtab,tildeFunction,tildeParen,tildeHexNumber,tildeOperator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn region tildeString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ keepend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn region tildeString contained start=+'+ skip=+\\\\\|\\"+ end=+'+ keepend
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn match tildeNumber "\d" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn match tildeOperator "or\|and" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn match tildeHexNumber "0x[a-z0-9]\+" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn match tildeVariable "$[a-z_0-9]\+" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn match tildeField "%[a-z_0-9]\+" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match tildeSymtab "@[a-z_0-9]\+" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn match tildeComment "^#.*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn region tildeCurly start=+{+ end=+}+ contained contains=tildeLG,tildeString,tildeNumber,tildeVariable,tildeField,tildeFunction,tildeSymtab,tildeHexNumber
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn match tildeLG "=>" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 hi def link tildeComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 hi def link tildeFunction Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 hi def link tildeOperator Operator
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 hi def link tildeString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 hi def link tildeNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 hi def link tildeHexNumber Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 hi def link tildeVariable Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 hi def link tildeField Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 hi def link tildeSymtab Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 hi def link tildeError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 let b:current_syntax = "tilde"