Mercurial > vim
annotate runtime/syntax/netrw.vim @ 34290:167d80fce1b1
runtime(doc): Clarify list-concatenation a bit more
Commit: https://github.com/vim/vim/commit/c9c2e2d2ff4429a6b5876ee919f15c1dc0018e86
Author: qeatzy <qeatzy@users.noreply.github.com>
Date: Wed Feb 7 17:52:25 2024 +0100
runtime(doc): Clarify list-concatenation a bit more
Make doc list-concatenation more clear as for += and extend().
1. describe `+=` for list-concatenation more accurately
2. add `extend()` example for list-concatenation
3. Fix CI errors for missing helptags reference |+=|
closes: #13983
Signed-off-by: qeatzy <qeatzy@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 07 Feb 2024 18:00:04 +0100 |
parents | 75ff30a78189 |
children | 02bd0fe77c68 |
rev | line source |
---|---|
12785 | 1 " Language : Netrw Listing Syntax |
6476 | 2 " Maintainer : Charles E. Campbell |
18594 | 3 " Last change: Nov 07, 2019 |
4 " Version : 20 | |
829 | 5 " --------------------------------------------------------------------- |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7183
diff
changeset
|
6 if exists("b:current_syntax") |
829 | 7 finish |
8 endif | |
9 | |
10 " --------------------------------------------------------------------- | |
11 " Directory List Syntax Highlighting: {{{1 | |
1619 | 12 syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt |
13 syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe | |
829 | 14 |
6476 | 15 syn match netrwPlain "\(\S\+ \)*\S\+" contains=netrwLink,@NoSpell |
2034 | 16 syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell |
17 syn match netrwDir "\.\{1,2}/" contains=netrwClassify,@NoSpell | |
5618 | 18 syn match netrwDir "\%(\S\+ \)*\S\+/\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell |
2034 | 19 syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains=netrwDateSep,@NoSpell nextgroup=netrwTime |
20 syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell | |
3153 | 21 syn match netrwExe "\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell |
6476 | 22 if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4') |
5618 | 23 syn match netrwTreeBar "^\%([-+|│] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup |
6476 | 24 else |
25 syn match netrwTreeBar "^\%([-+|] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup | |
26 endif | |
2034 | 27 syn match netrwTreeBarSpace " " contained |
829 | 28 |
2034 | 29 syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained |
30 syn match netrwDateSep "/" contained | |
31 syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep | |
1121 | 32 syn match netrwTimeSep ":" |
829 | 33 |
2034 | 34 syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup,@NoSpell |
35 syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite contains=@NoSpell nextgroup=netrwHidePat | |
829 | 36 syn match netrwSlash "/" contained |
2034 | 37 syn match netrwHidePat "[^,]\+" contained skipwhite contains=@NoSpell nextgroup=netrwHideSep |
38 syn match netrwHideSep "," contained skipwhite nextgroup=netrwHidePat | |
39 syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList | |
40 syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList | |
41 syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList | |
42 syn match netrwList ".*$" contained contains=netrwComma,@NoSpell | |
829 | 43 syn match netrwComma "," contained |
5734 | 44 syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd,netrwQHTopic,@NoSpell keepend contained |
45 syn match netrwHelpCmd "\S\+\ze:" contained skipwhite contains=@NoSpell nextgroup=netrwCmdSep | |
6476 | 46 syn match netrwQHTopic "([a-zA-Z &]\+)" contained skipwhite |
829 | 47 syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote |
2034 | 48 syn match netrwCmdNote ".\{-}\ze " contained contains=@NoSpell |
49 syn match netrwVersion "(netrw.*)" contained contains=@NoSpell | |
6476 | 50 syn match netrwLink "-->" contained skipwhite |
829 | 51 |
1619 | 52 " ----------------------------- |
53 " Special filetype highlighting {{{1 | |
54 " ----------------------------- | |
12785 | 55 if exists("g:netrw_special_syntax") && g:netrw_special_syntax |
56 if exists("+suffixes") && &suffixes != "" | |
57 let suflist= join(split(&suffixes,',')) | |
58 let suflist= escape(substitute(suflist," ",'\\|','g'),'.~') | |
59 exe "syn match netrwSpecFile '\\(\\S\\+ \\)*\\S*\\(".suflist."\\)\\>' contains=netrwTreeBar,@NoSpell" | |
60 endif | |
61 syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar,@NoSpell | |
62 syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar,@NoSpell | |
2034 | 63 if has("unix") |
12785 | 64 syn match netrwCoreDump "\<core\%(\.\d\+\)\=\>" contains=netrwTreeBar,@NoSpell |
2034 | 65 endif |
12785 | 66 syn match netrwLex "\(\S\+ \)*\S\+\.\%(l\|lex\)\>" contains=netrwTreeBar,@NoSpell |
67 syn match netrwYacc "\(\S\+ \)*\S\+\.y\>" contains=netrwTreeBar,@NoSpell | |
68 syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar,@NoSpell | |
69 syn match netrwDoc "\(\S\+ \)*\S\+\.\%(doc\|txt\|pdf\|ps\|docx\)\>" contains=netrwTreeBar,@NoSpell | |
70 syn match netrwHdr "\(\S\+ \)*\S\+\.\%(h\|hpp\)\>" contains=netrwTreeBar,@NoSpell | |
71 syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar,@NoSpell | |
72 syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar,@NoSpell | |
73 syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar,@NoSpell | |
74 syn match netrwPix "\c\(\S\+ \)*\S*\.\%(bmp\|fits\=\|gif\|je\=pg\|pcx\|ppc\|pgm\|png\|ppm\|psd\|rgb\|tif\|xbm\|xcf\)\>" contains=netrwTreeBar,@NoSpell | |
75 syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar,@NoSpell | |
76 syn match netrwTags "\<tags\>" contains=netrwTreeBar,@NoSpell | |
77 syn match netrwTilde "\(\S\+ \)*\S\+\~\*\=\>" contains=netrwTreeBar,@NoSpell | |
78 syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell | |
1619 | 79 endif |
80 | |
829 | 81 " --------------------------------------------------------------------- |
82 " Highlighting Links: {{{1 | |
1619 | 83 if !exists("did_drchip_netrwlist_syntax") |
829 | 84 let did_drchip_netrwlist_syntax= 1 |
2034 | 85 hi default link netrwClassify Function |
86 hi default link netrwCmdSep Delimiter | |
87 hi default link netrwComment Comment | |
88 hi default link netrwDir Directory | |
89 hi default link netrwHelpCmd Function | |
5734 | 90 hi default link netrwQHTopic Number |
2034 | 91 hi default link netrwHidePat Statement |
92 hi default link netrwHideSep netrwComment | |
93 hi default link netrwList Statement | |
94 hi default link netrwVersion Identifier | |
95 hi default link netrwSymLink Question | |
96 hi default link netrwExe PreProc | |
97 hi default link netrwDateSep Delimiter | |
829 | 98 |
2034 | 99 hi default link netrwTreeBar Special |
100 hi default link netrwTimeSep netrwDateSep | |
101 hi default link netrwComma netrwComment | |
102 hi default link netrwHide netrwComment | |
2908 | 103 hi default link netrwMarkFile TabLineSel |
6476 | 104 hi default link netrwLink Special |
1619 | 105 |
106 " special syntax highlighting (see :he g:netrw_special_syntax) | |
2034 | 107 hi default link netrwCoreDump WarningMsg |
22328 | 108 hi default link netrwData Folded |
4339 | 109 hi default link netrwHdr netrwPlain |
110 hi default link netrwLex netrwPlain | |
2034 | 111 hi default link netrwLib DiffChange |
112 hi default link netrwMakefile DiffChange | |
4339 | 113 hi default link netrwYacc netrwPlain |
12785 | 114 hi default link netrwPix Special |
115 | |
116 hi default link netrwBak netrwGray | |
117 hi default link netrwCompress netrwGray | |
118 hi default link netrwSpecFile netrwGray | |
119 hi default link netrwObj netrwGray | |
120 hi default link netrwTags netrwGray | |
121 hi default link netrwTilde netrwGray | |
122 hi default link netrwTmp netrwGray | |
829 | 123 endif |
124 | |
12785 | 125 " set up netrwGray to be understated (but not Ignore'd or Conceal'd, as those |
126 " can be hard/impossible to read). Users may override this in a colorscheme by | |
127 " specifying netrwGray highlighting. | |
128 redir => s:netrwgray | |
129 sil hi netrwGray | |
130 redir END | |
131 if s:netrwgray !~ 'guifg' | |
132 if has("gui") && has("gui_running") | |
133 if &bg == "dark" | |
134 exe "hi netrwGray gui=NONE guifg=gray30" | |
135 else | |
136 exe "hi netrwGray gui=NONE guifg=gray70" | |
137 endif | |
138 else | |
139 hi link netrwGray Folded | |
140 endif | |
141 endif | |
142 | |
829 | 143 " Current Syntax: {{{1 |
144 let b:current_syntax = "netrwlist" | |
145 " --------------------------------------------------------------------- | |
146 " vim: ts=8 fdm=marker |