annotate runtime/syntax/man.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 050794aa4ef2
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: Man page
20241
56265f711890 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
3 " Maintainer: Jason Franklin <vim@justemail.net>
56265f711890 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
4 " Previous Maintainer: SungHyun Nam <goweol@gmail.com>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Previous Maintainer: Gautam H. Mudunuri <gmudunur@informatica.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " Version Info:
22441
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20241
diff changeset
7 " Last Change: 2020 Sep 19
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " Additional highlighting by Johannes Tanzler <johannes.tanzler@aon.at>:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 " * manSubHeading
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 " * manSynopsis (only for sections 2 and 3)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7272
diff changeset
13 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7272
diff changeset
14 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 " Get the CTRL-H syntax to handle backspaced text
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7272
diff changeset
19 runtime! syntax/ctrlh.vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn case ignore
20115
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
22
32837
050794aa4ef2 man.vim: Recognise hyphenated-at-eol cross-references (#12609)
Christian Brabandt <cb@256bit.org>
parents: 22441
diff changeset
23 " See notes about hyphenation in s:ParseIntoPageAndSection of
050794aa4ef2 man.vim: Recognise hyphenated-at-eol cross-references (#12609)
Christian Brabandt <cb@256bit.org>
parents: 22441
diff changeset
24 " autoload/dist/man.vim.
050794aa4ef2 man.vim: Recognise hyphenated-at-eol cross-references (#12609)
Christian Brabandt <cb@256bit.org>
parents: 22441
diff changeset
25 syn match manReference "\%(\f\+[\u2010-]\%(\n\|\r\n\=\)\s\+\)\=\f\+([1-9]\l*)"
22441
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20241
diff changeset
26 syn match manSectionHeading "^\a.*$"
a3bb84cd0f59 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 20241
diff changeset
27 syn match manSubHeading "^\s\{3\}\a.*$"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn match manOptionDesc "^\s*[+-][a-z0-9]\S*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn match manLongOptionDesc "^\s*--[a-z0-9-]\S*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " syn match manHistory "^[a-z].*last change.*$"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
20241
56265f711890 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
32 syn match manHeader '\%1l.*'
56265f711890 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
33 exe 'syn match manFooter ''\%' . line('$') . 'l.*'''
56265f711890 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 20115
diff changeset
34
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 if getline(1) =~ '^[a-zA-Z_]\+([23])'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syntax include @cCode <sfile>:p:h/c.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn match manCFuncDefinition display "\<\h\w*\>\s*("me=e-1 contained
1621
82b5078be2dd updated for version 7.2a
vimboss
parents: 7
diff changeset
38 syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"me=e-12 keepend contains=manSectionHeading,@cCode,manCFuncDefinition
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7272
diff changeset
43 " Only when an item doesn't have highlighting yet
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44
20115
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
45 hi def link manHeader Title
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
46 hi def link manFooter PreProc
bd021eb62e73 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
47
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
48 hi def link manSectionHeading Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
49 hi def link manOptionDesc Constant
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
50 hi def link manLongOptionDesc Constant
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
51 hi def link manReference PreProc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
52 hi def link manSubHeading Function
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
53 hi def link manCFuncDefinition Function
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 let b:current_syntax = "man"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 " vim:ts=8 sts=2 sw=2: