Skip to content

Commit 9704a38

Browse files
committed
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
1 parent 55a8954 commit 9704a38

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

syntax/nerdtree.vim

+11-6
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ syn match NERDTreeHelp #^".*# contains=NERDTreeHelpKey,NERDTreeHelpTitle,NERDTr
3131
syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile
3232

3333
"highlighting for sym links
34-
syn match NERDTreeLink #[^-| `].* -> # contains=NERDTreeBookmark,NERDTreeOpenable,NERDTreeClosable,NERDTreeDirSlash
34+
syn match NERDTreeLinkTarget #->.*# containedin=NERDTreeDir,NERDTreeFile
35+
syn match NERDTreeLinkFile #.* ->#me=e-3 containedin=NERDTreeFile
36+
syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir
3537

3638
"highlighing for directory nodes and file nodes
3739
syn match NERDTreeDirSlash #/#
38-
syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable
39-
syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark
40-
syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
41-
syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
40+
syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable
41+
syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark
42+
syn match NERDTreeFile #|-.*# contains=NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
43+
syn match NERDTreeFile #`-.*# contains=NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile
4244
syn match NERDTreeCWD #^[</].*$#
4345

4446
"highlighting for bookmarks
@@ -76,10 +78,13 @@ hi def link NERDTreeHelpTitle Macro
7678
hi def link NERDTreeToggleOn Question
7779
hi def link NERDTreeToggleOff WarningMsg
7880

81+
hi def link NERDTreeLinkTarget Type
82+
hi def link NERDTreeLinkFile Macro
83+
hi def link NERDTreeLinkDir Macro
84+
7985
hi def link NERDTreeDir Directory
8086
hi def link NERDTreeUp Directory
8187
hi def link NERDTreeCWD Statement
82-
hi def link NERDTreeLink Macro
8388
hi def link NERDTreeOpenable Title
8489
hi def link NERDTreeFlag ignore
8590
hi def link NERDTreeRO WarningMsg

0 commit comments

Comments
 (0)