1
0
Fork 0
mirror of synced 2024-11-18 06:55:33 -05:00
ultimate-vim/sources_non_forked/nerdtree/syntax/nerdtree.vim

98 lines
4.5 KiB
VimL
Raw Normal View History

2012-08-16 23:41:25 -04:00
let s:tree_up_dir_line = '.. (up a dir)'
2014-08-03 18:02:51 -04:00
syn match NERDTreeIgnore #\~#
2016-05-14 07:57:54 -04:00
exec 'syn match NERDTreeIgnore #\['.g:NERDTreeGlyphReadOnly.'\]#'
2012-08-16 23:41:25 -04:00
"highlighting for the .. (up dir) line at the top of the tree
2020-01-07 07:45:07 -05:00
execute "syn match NERDTreeUp #\\V". s:tree_up_dir_line .'#'
2012-08-16 23:41:25 -04:00
"quickhelp syntax elements
2014-07-02 07:18:18 -04:00
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*:#ms=s+2,me=e-1
syn match NERDTreeHelpKey #" \{1,2\}[^ ]*,#ms=s+2,me=e-1
2017-09-02 06:43:18 -04:00
syn match NERDTreeHelpTitle #" .*\~$#ms=s+2,me=e-1
2014-07-02 07:18:18 -04:00
syn match NERDTreeToggleOn #(on)#ms=s+1,he=e-1
syn match NERDTreeToggleOff #(off)#ms=e-3,me=e-1
2012-08-16 23:41:25 -04:00
syn match NERDTreeHelpCommand #" :.\{-}\>#hs=s+3
2014-08-03 18:02:51 -04:00
syn match NERDTreeHelp #^".*# contains=NERDTreeHelpKey,NERDTreeHelpTitle,NERDTreeIgnore,NERDTreeToggleOff,NERDTreeToggleOn,NERDTreeHelpCommand
2012-08-16 23:41:25 -04:00
"highlighting for sym links
2014-07-02 07:18:18 -04:00
syn match NERDTreeLinkTarget #->.*# containedin=NERDTreeDir,NERDTreeFile
syn match NERDTreeLinkFile #.* ->#me=e-3 containedin=NERDTreeFile
syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir
2012-08-16 23:41:25 -04:00
2020-04-25 21:56:16 -04:00
"highlighting to conceal the delimiter around the file/dir name
2020-01-07 07:45:07 -05:00
if has('conceal')
2018-12-17 06:28:27 -05:00
exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# conceal containedin=ALL'
2020-06-21 11:50:44 -04:00
setlocal conceallevel=2 concealcursor=nvic
2018-11-01 06:03:42 -04:00
else
2018-12-17 06:28:27 -05:00
exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# containedin=ALL'
2018-11-01 06:03:42 -04:00
hi! link NERDTreeNodeDelimiters Ignore
endif
2020-04-25 21:56:16 -04:00
"highlighing for directory nodes and file nodes
syn match NERDTreeDirSlash #/# containedin=NERDTreeDir
if g:NERDTreeDirArrowExpandable !=# ''
exec 'syn match NERDTreeClosable #' . escape(g:NERDTreeDirArrowCollapsible, '~') . '\ze .*/# containedin=NERDTreeDir,NERDTreeFile'
exec 'syn match NERDTreeOpenable #' . escape(g:NERDTreeDirArrowExpandable, '~') . '\ze .*/# containedin=NERDTreeDir,NERDTreeFile'
let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~]\-').escape(g:NERDTreeDirArrowExpandable, '~]\-')
exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#'
2021-10-11 05:30:43 -04:00
exec 'syn match NERDTreeExecFile #^.*'.g:NERDTreeNodeDelimiter.'\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmarkName'
exec 'syn match NERDTreeFile #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmarkName,NERDTreeExecFile'
2020-04-25 21:56:16 -04:00
else
exec 'syn match NERDTreeDir #[^'.g:NERDTreeNodeDelimiter.']\{-}/\ze\($\|'.g:NERDTreeNodeDelimiter.'\)#'
2021-10-11 05:30:43 -04:00
exec 'syn match NERDTreeExecFile #[^'.g:NERDTreeNodeDelimiter.']\{-}'.g:NERDTreeNodeDelimiter.'\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmarkName'
exec 'syn match NERDTreeFile #^.*'.g:NERDTreeNodeDelimiter.'.*[^\/]\($\|'.g:NERDTreeNodeDelimiter.'.*\)# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmarkName,NERDTreeExecFile'
2020-04-25 21:56:16 -04:00
endif
"highlighting for readonly files
2021-10-11 05:30:43 -04:00
exec 'syn match NERDTreeRO #.*'.g:NERDTreeNodeDelimiter.'\zs.*\ze'.g:NERDTreeNodeDelimiter.'.*\['.g:NERDTreeGlyphReadOnly.'\]# contains=NERDTreeIgnore,NERDTreeBookmarkName,NERDTreeFile'
2020-04-25 21:56:16 -04:00
2020-12-04 16:15:32 -05:00
exec 'syn match NERDTreeFlags #\[[^\]]*\]\ze'.g:NERDTreeNodeDelimiter.'# containedin=NERDTreeFile,NERDTreeExecFile,NERDTreeLinkFile,NERDTreeRO,NERDTreeDir'
2020-04-25 21:56:16 -04:00
2012-08-16 23:41:25 -04:00
syn match NERDTreeCWD #^[</].*$#
"highlighting for bookmarks
2021-10-11 05:30:43 -04:00
syn match NERDTreeBookmarkName # {.*}#hs=s+2,he=e-1
2012-08-16 23:41:25 -04:00
"highlighting for the bookmarks table
syn match NERDTreeBookmarksLeader #^>#
syn match NERDTreeBookmarksHeader #^>-\+Bookmarks-\+$# contains=NERDTreeBookmarksLeader
syn match NERDTreeBookmarkName #^>.\{-} #he=e-1 contains=NERDTreeBookmarksLeader
syn match NERDTreeBookmark #^>.*$# contains=NERDTreeBookmarksLeader,NERDTreeBookmarkName,NERDTreeBookmarksHeader
2014-07-02 07:18:18 -04:00
hi def link NERDTreePart Special
hi def link NERDTreePartFile Type
hi def link NERDTreeExecFile Title
hi def link NERDTreeDirSlash Identifier
2012-08-16 23:41:25 -04:00
hi def link NERDTreeBookmarksHeader statement
hi def link NERDTreeBookmarksLeader ignore
hi def link NERDTreeBookmarkName Identifier
hi def link NERDTreeBookmark normal
hi def link NERDTreeHelp String
hi def link NERDTreeHelpKey Identifier
hi def link NERDTreeHelpCommand Identifier
hi def link NERDTreeHelpTitle Macro
hi def link NERDTreeToggleOn Question
hi def link NERDTreeToggleOff WarningMsg
2014-07-02 07:18:18 -04:00
hi def link NERDTreeLinkTarget Type
hi def link NERDTreeLinkFile Macro
hi def link NERDTreeLinkDir Macro
2012-08-16 23:41:25 -04:00
hi def link NERDTreeDir Directory
hi def link NERDTreeUp Directory
2014-07-02 07:18:18 -04:00
hi def link NERDTreeFile Normal
2012-08-16 23:41:25 -04:00
hi def link NERDTreeCWD Statement
2016-11-09 12:22:55 -05:00
hi def link NERDTreeOpenable Directory
hi def link NERDTreeClosable Directory
2014-08-03 18:02:51 -04:00
hi def link NERDTreeIgnore ignore
2012-08-16 23:41:25 -04:00
hi def link NERDTreeRO WarningMsg
hi def link NERDTreeBookmark Statement
2014-08-03 18:02:51 -04:00
hi def link NERDTreeFlags Number
2012-08-16 23:41:25 -04:00
hi def link NERDTreeCurrentNode Search
2020-12-04 16:15:32 -05:00
hi NERDTreeFile ctermbg=NONE guibg=NONE