0
0
mirror of https://github.com/vim/vim.git synced 2025-07-24 10:45:12 -04:00
vim/runtime/syntax/netrw.vim

104 lines
4.6 KiB
VimL
Raw Normal View History

2004-06-20 12:51:53 +00:00
" Language : Netrw Remote-Directory Listing Syntax
" Maintainer : Charles E. Campbell, Jr.
2008-06-24 20:39:31 +00:00
" Last change: Feb 06, 2008
" Version : 12
2004-09-02 19:12:26 +00:00
" ---------------------------------------------------------------------
2004-06-20 12:51:53 +00:00
" Syntax Clearing: {{{1
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
2004-09-02 19:12:26 +00:00
" ---------------------------------------------------------------------
2004-06-20 12:51:53 +00:00
" Directory List Syntax Highlighting: {{{1
2008-06-24 20:39:31 +00:00
syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt
syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe
2005-09-10 19:22:57 +00:00
2008-06-24 20:39:31 +00:00
syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify
syn match netrwDir "\.\{1,2}/" contains=netrwClassify
syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify
syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" contains=netrwDateSep skipwhite nextgroup=netrwTime
syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify
syn match netrwExe "\%(\S\+ \)*\S\+\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify
syn match netrwTreeBar "^\%(| \)*" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
syn match netrwTreeBarSpace " " contained
2005-09-10 19:22:57 +00:00
syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained
2007-05-05 17:54:07 +00:00
syn match netrwDateSep "/" contained
2008-06-24 20:39:31 +00:00
syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep
2007-05-05 17:54:07 +00:00
syn match netrwTimeSep ":"
2005-09-10 19:22:57 +00:00
2008-06-24 20:39:31 +00:00
syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup
2005-09-10 19:22:57 +00:00
syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite nextgroup=netrwHidePat
syn match netrwSlash "/" contained
syn match netrwHidePat "[^,]\+" contained skipwhite nextgroup=netrwHideSep
syn match netrwHideSep "," contained transparent skipwhite nextgroup=netrwHidePat
syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList
syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList
2008-06-24 20:39:31 +00:00
syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList
syn match netrwList ".*$" contained contains=netrwComma
2005-09-10 19:22:57 +00:00
syn match netrwComma "," contained
2008-06-24 20:39:31 +00:00
syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd keepend contained
2005-09-10 19:22:57 +00:00
syn match netrwHelpCmd "\S\ze:" contained skipwhite nextgroup=netrwCmdSep
syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote
syn match netrwCmdNote ".\{-}\ze " contained
syn match netrwVersion "(netrw.*)" contained
2004-06-20 12:51:53 +00:00
2008-06-24 20:39:31 +00:00
" -----------------------------
" Special filetype highlighting {{{1
" -----------------------------
if exists("g:netrw_special_syntax") && netrw_special_syntax
syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar
syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar
syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar
syn match netrwHdr "\(\S\+ \)*\S\+\.h\>" contains=netrwTreeBar
syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar
syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar
syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar
syn match netrwTags "\<tags\>" contains=netrwTreeBar
syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar
syn match netrwTilde "\(\S\+ \)*\S\+\~\>" contains=netrwTreeBar
syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar
endif
2004-09-02 19:12:26 +00:00
" ---------------------------------------------------------------------
2004-06-20 12:51:53 +00:00
" Highlighting Links: {{{1
2008-06-24 20:39:31 +00:00
if !exists("did_drchip_netrwlist_syntax")
2004-06-20 12:51:53 +00:00
let did_drchip_netrwlist_syntax= 1
2004-06-30 16:16:41 +00:00
hi link netrwClassify Function
2004-09-02 19:12:26 +00:00
hi link netrwCmdSep Delimiter
2004-06-20 12:51:53 +00:00
hi link netrwComment Comment
hi link netrwDir Directory
2004-09-02 19:12:26 +00:00
hi link netrwHelpCmd Function
hi link netrwHidePat Statement
hi link netrwList Statement
hi link netrwVersion Identifier
2008-06-24 20:39:31 +00:00
hi link netrwSymLink Question
2005-09-10 19:22:57 +00:00
hi link netrwExe PreProc
2007-05-05 17:54:07 +00:00
hi link netrwDateSep Delimiter
2004-07-02 15:38:35 +00:00
2008-06-24 20:39:31 +00:00
hi link netrwTreeBar Special
2007-05-05 17:54:07 +00:00
hi link netrwTimeSep netrwDateSep
2004-07-02 15:38:35 +00:00
hi link netrwComma netrwComment
hi link netrwHide netrwComment
2008-06-24 20:39:31 +00:00
hi link netrwMarkFile Identifier
" special syntax highlighting (see :he g:netrw_special_syntax)
hi link netrwBak NonText
hi link netrwCompress Folded
hi link netrwData DiffChange
hi link netrwLib DiffChange
hi link netrwMakefile DiffChange
hi link netrwObj Folded
hi link netrwTilde Folded
hi link netrwTmp Folded
hi link netrwTags Folded
2004-06-20 12:51:53 +00:00
endif
" Current Syntax: {{{1
let b:current_syntax = "netrwlist"
2004-09-02 19:12:26 +00:00
" ---------------------------------------------------------------------
2004-06-20 12:51:53 +00:00
" vim: ts=8 fdm=marker