1 " Language : Netrw Remote-Directory Listing Syntax
2 " Maintainer : Charles E. Campbell, Jr.
3 " Last change: Feb 06, 2008
5 " ---------------------------------------------------------------------
7 " Syntax Clearing: {{{1
10 elseif exists("b:current_syntax")
14 " ---------------------------------------------------------------------
15 " Directory List Syntax Highlighting: {{{1
16 syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt
17 syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe
19 syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify
20 syn match netrwDir "\.\{1,2}/" contains=netrwClassify
21 syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify
22 syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" contains=netrwDateSep skipwhite nextgroup=netrwTime
23 syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify
24 syn match netrwExe "\%(\S\+ \)*\S\+\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify
25 syn match netrwTreeBar "^\%(| \)*" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
26 syn match netrwTreeBarSpace " " contained
28 syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained
29 syn match netrwDateSep "/" contained
30 syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep
31 syn match netrwTimeSep ":"
33 syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup
34 syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite nextgroup=netrwHidePat
35 syn match netrwSlash "/" contained
36 syn match netrwHidePat "[^,]\+" contained skipwhite nextgroup=netrwHideSep
37 syn match netrwHideSep "," contained transparent skipwhite nextgroup=netrwHidePat
38 syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList
39 syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList
40 syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList
41 syn match netrwList ".*$" contained contains=netrwComma
42 syn match netrwComma "," contained
43 syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd keepend contained
44 syn match netrwHelpCmd "\S\ze:" contained skipwhite nextgroup=netrwCmdSep
45 syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote
46 syn match netrwCmdNote ".\{-}\ze " contained
47 syn match netrwVersion "(netrw.*)" contained
49 " -----------------------------
50 " Special filetype highlighting {{{1
51 " -----------------------------
52 if exists("g:netrw_special_syntax") && netrw_special_syntax
53 syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar
54 syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar
55 syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar
56 syn match netrwHdr "\(\S\+ \)*\S\+\.h\>" contains=netrwTreeBar
57 syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar
58 syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar
59 syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar
60 syn match netrwTags "\<tags\>" contains=netrwTreeBar
61 syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar
62 syn match netrwTilde "\(\S\+ \)*\S\+\~\>" contains=netrwTreeBar
63 syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar
66 " ---------------------------------------------------------------------
67 " Highlighting Links: {{{1
68 if !exists("did_drchip_netrwlist_syntax")
69 let did_drchip_netrwlist_syntax= 1
70 hi link netrwClassify Function
71 hi link netrwCmdSep Delimiter
72 hi link netrwComment Comment
73 hi link netrwDir Directory
74 hi link netrwHelpCmd Function
75 hi link netrwHidePat Statement
76 hi link netrwList Statement
77 hi link netrwVersion Identifier
78 hi link netrwSymLink Question
79 hi link netrwExe PreProc
80 hi link netrwDateSep Delimiter
82 hi link netrwTreeBar Special
83 hi link netrwTimeSep netrwDateSep
84 hi link netrwComma netrwComment
85 hi link netrwHide netrwComment
86 hi link netrwMarkFile Identifier
88 " special syntax highlighting (see :he g:netrw_special_syntax)
89 hi link netrwBak NonText
90 hi link netrwCompress Folded
91 hi link netrwData DiffChange
92 hi link netrwLib DiffChange
93 hi link netrwMakefile DiffChange
94 hi link netrwObj Folded
95 hi link netrwTilde Folded
96 hi link netrwTmp Folded
97 hi link netrwTags Folded
100 " Current Syntax: {{{1
101 let b:current_syntax = "netrwlist"
102 " ---------------------------------------------------------------------
103 " vim: ts=8 fdm=marker