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