update symlink highlighting

Previously we highlighted symlinks as one item (NERDTreeLink):

    symlinked_file -> /path/to/target

Split this out into 3 highlight groups:
    * NERDTreeLinkFile
    * NERDTreeLinkDir
    * NERDTreeLinkTarget

So we have:

    symlinked_dir/ -> /foo/bar
    -------------- ***********
         ^               ^
         |               |
    NERDTreeLinkDir   NERDTreeLinkTarget

Similarly for file links - with NERDTreeLinkFile instead of
NERDTreeLinkDir.

This allows users to modify how symlinks are highlighted. E.g. to make
them appear as normal files/dirs they could add this to their vimrc:

    hi link NERDTreeLinkFile NERDTreeFile
    hi link NERDTreeLinkDir NERDTreeDir
    hi link NERDTreeLinkTarget ignore
This commit is contained in:
Martin Grenfell 2014-06-29 16:14:51 +01:00
parent 55a8954c48
commit 9704a38a14

View File

@ -31,14 +31,16 @@ syn match NERDTreeHelp #^".*# contains=NERDTreeHelpKey,NERDTreeHelpTitle,NERDTr
syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile
"highlighting for sym links "highlighting for sym links
syn match NERDTreeLink #[^-| `].* -> # contains=NERDTreeBookmark,NERDTreeOpenable,NERDTreeClosable,NERDTreeDirSlash syn match NERDTreeLinkTarget #->.*# containedin=NERDTreeDir,NERDTreeFile
syn match NERDTreeLinkFile #.* ->#me=e-3 containedin=NERDTreeFile
syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir
"highlighing for directory nodes and file nodes "highlighing for directory nodes and file nodes
syn match NERDTreeDirSlash #/# syn match NERDTreeDirSlash #/#
syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable
syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark
syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile syn match NERDTreeFile #|-.*# contains=NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile syn match NERDTreeFile #`-.*# contains=NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
syn match NERDTreeCWD #^[</].*$# syn match NERDTreeCWD #^[</].*$#
"highlighting for bookmarks "highlighting for bookmarks
@ -76,10 +78,13 @@ hi def link NERDTreeHelpTitle Macro
hi def link NERDTreeToggleOn Question hi def link NERDTreeToggleOn Question
hi def link NERDTreeToggleOff WarningMsg hi def link NERDTreeToggleOff WarningMsg
hi def link NERDTreeLinkTarget Type
hi def link NERDTreeLinkFile Macro
hi def link NERDTreeLinkDir Macro
hi def link NERDTreeDir Directory hi def link NERDTreeDir Directory
hi def link NERDTreeUp Directory hi def link NERDTreeUp Directory
hi def link NERDTreeCWD Statement hi def link NERDTreeCWD Statement
hi def link NERDTreeLink Macro
hi def link NERDTreeOpenable Title hi def link NERDTreeOpenable Title
hi def link NERDTreeFlag ignore hi def link NERDTreeFlag ignore
hi def link NERDTreeRO WarningMsg hi def link NERDTreeRO WarningMsg