1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-04-03 16:36:44 +02:00
vim/runtime/syntax/netrw.vim

123 lines
6.1 KiB
VimL
Raw Normal View History

2004-06-20 12:51:53 +00:00
" Language : Netrw Remote-Directory Listing Syntax
2015-01-07 16:57:10 +01:00
" Maintainer : Charles E. Campbell
" Last change: Oct 06, 2014
" Version : 19
2004-09-02 19:12:26 +00:00
" ---------------------------------------------------------------------
2004-06-20 12:51:53 +00:00
" Syntax Clearing: {{{1
" quit when a syntax file was already loaded
if exists("b:current_syntax")
2004-06-20 12:51:53 +00:00
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
2015-01-07 16:57:10 +01:00
syn match netrwPlain "\(\S\+ \)*\S\+" contains=netrwLink,@NoSpell
2010-01-06 20:54:52 +01:00
syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
syn match netrwDir "\.\{1,2}/" contains=netrwClassify,@NoSpell
2014-01-23 14:24:41 +01:00
syn match netrwDir "\%(\S\+ \)*\S\+/\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
2010-01-06 20:54:52 +01:00
syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains=netrwDateSep,@NoSpell nextgroup=netrwTime
syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
2011-10-20 22:22:38 +02:00
syn match netrwExe "\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
2015-01-07 16:57:10 +01:00
if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4')
2014-01-23 14:24:41 +01:00
syn match netrwTreeBar "^\%([-+|│] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
2015-01-07 16:57:10 +01:00
else
syn match netrwTreeBar "^\%([-+|] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
endif
2010-01-06 20:54:52 +01:00
syn match netrwTreeBarSpace " " contained
2005-09-10 19:22:57 +00:00
2010-01-06 20:54:52 +01:00
syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained
syn match netrwDateSep "/" contained
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
2010-01-06 20:54:52 +01:00
syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup,@NoSpell
syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite contains=@NoSpell nextgroup=netrwHidePat
2005-09-10 19:22:57 +00:00
syn match netrwSlash "/" contained
2010-01-06 20:54:52 +01:00
syn match netrwHidePat "[^,]\+" contained skipwhite contains=@NoSpell nextgroup=netrwHideSep
syn match netrwHideSep "," contained skipwhite nextgroup=netrwHidePat
syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList
syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList
syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList
syn match netrwList ".*$" contained contains=netrwComma,@NoSpell
2005-09-10 19:22:57 +00:00
syn match netrwComma "," contained
2014-03-22 21:02:50 +01:00
syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd,netrwQHTopic,@NoSpell keepend contained
syn match netrwHelpCmd "\S\+\ze:" contained skipwhite contains=@NoSpell nextgroup=netrwCmdSep
2015-01-07 16:57:10 +01:00
syn match netrwQHTopic "([a-zA-Z &]\+)" contained skipwhite
2005-09-10 19:22:57 +00:00
syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote
2010-01-06 20:54:52 +01:00
syn match netrwCmdNote ".\{-}\ze " contained contains=@NoSpell
syn match netrwVersion "(netrw.*)" contained contains=@NoSpell
2015-01-07 16:57:10 +01:00
syn match netrwLink "-->" contained skipwhite
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
2010-01-06 20:54:52 +01:00
syn match netrwBak "\(\S\+ \)*\S\+\.bak\>" contains=netrwTreeBar,@NoSpell
syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>" contains=netrwTreeBar,@NoSpell
if has("unix")
syn match netrwCoreDump "\<core\%(\.\d\+\)\=\>" contains=netrwTreeBar,@NoSpell
endif
2013-04-24 18:51:19 +02:00
syn match netrwLex "\(\S\+ \)*\S\+\.\%(l\|lex\)\>" contains=netrwTreeBar,@NoSpell
syn match netrwYacc "\(\S\+ \)*\S\+\.y\>" contains=netrwTreeBar,@NoSpell
2010-01-06 20:54:52 +01:00
syn match netrwData "\(\S\+ \)*\S\+\.dat\>" contains=netrwTreeBar,@NoSpell
2013-04-24 18:51:19 +02:00
syn match netrwDoc "\(\S\+ \)*\S\+\.\%(doc\|txt\|pdf\|ps\)" contains=netrwTreeBar,@NoSpell
syn match netrwHdr "\(\S\+ \)*\S\+\.\%(h\|hpp\)\>" contains=netrwTreeBar,@NoSpell
2010-01-06 20:54:52 +01:00
syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>" contains=netrwTreeBar,@NoSpell
syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>" contains=netrwTreeBar,@NoSpell
syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>" contains=netrwTreeBar,@NoSpell
syn match netrwTags "\<\(ANmenu\|ANtags\)\>" contains=netrwTreeBar,@NoSpell
2013-04-24 18:51:19 +02:00
syn match netrwTags "\<tags\>" contains=netrwTreeBar,@NoSpell
2011-10-20 22:22:38 +02:00
syn match netrwTilde "\(\S\+ \)*\S\+\~\*\=\>" contains=netrwTreeBar,@NoSpell
2010-01-06 20:54:52 +01:00
syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell
2008-06-24 20:39:31 +00:00
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
2010-01-06 20:54:52 +01:00
hi default link netrwClassify Function
hi default link netrwCmdSep Delimiter
hi default link netrwComment Comment
hi default link netrwDir Directory
hi default link netrwHelpCmd Function
2014-03-22 21:02:50 +01:00
hi default link netrwQHTopic Number
2010-01-06 20:54:52 +01:00
hi default link netrwHidePat Statement
hi default link netrwHideSep netrwComment
hi default link netrwList Statement
hi default link netrwVersion Identifier
hi default link netrwSymLink Question
hi default link netrwExe PreProc
hi default link netrwDateSep Delimiter
2004-07-02 15:38:35 +00:00
2010-01-06 20:54:52 +01:00
hi default link netrwTreeBar Special
hi default link netrwTimeSep netrwDateSep
hi default link netrwComma netrwComment
hi default link netrwHide netrwComment
2011-06-19 05:09:16 +02:00
hi default link netrwMarkFile TabLineSel
2015-01-07 16:57:10 +01:00
hi default link netrwLink Special
2008-06-24 20:39:31 +00:00
" special syntax highlighting (see :he g:netrw_special_syntax)
2010-01-06 20:54:52 +01:00
hi default link netrwBak NonText
hi default link netrwCompress Folded
hi default link netrwCoreDump WarningMsg
hi default link netrwData DiffChange
2013-04-24 18:51:19 +02:00
hi default link netrwHdr netrwPlain
hi default link netrwLex netrwPlain
2010-01-06 20:54:52 +01:00
hi default link netrwLib DiffChange
hi default link netrwMakefile DiffChange
hi default link netrwObj Folded
hi default link netrwTilde Folded
hi default link netrwTmp Folded
hi default link netrwTags Folded
2013-04-24 18:51:19 +02:00
hi default link netrwYacc netrwPlain
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