From 9704a38a14854aa282748d18cb3042c7f3ebd01a Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sun, 29 Jun 2014 16:14:51 +0100 Subject: [PATCH] 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 --- syntax/nerdtree.vim | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/syntax/nerdtree.vim b/syntax/nerdtree.vim index 636d2af..87fdfb8 100644 --- a/syntax/nerdtree.vim +++ b/syntax/nerdtree.vim @@ -31,14 +31,16 @@ syn match NERDTreeHelp #^".*# contains=NERDTreeHelpKey,NERDTreeHelpTitle,NERDTr syn match NERDTreeRO #.*\[RO\]#hs=s+2 contains=NERDTreeFlag,NERDTreeBookmark,NERDTreePart,NERDTreePartFile "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 syn match NERDTreeDirSlash #/# -syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable -syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark -syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile -syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile +syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeDirSlash,NERDTreeOpenable,NERDTreeClosable +syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark +syn match NERDTreeFile #|-.*# contains=NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile +syn match NERDTreeFile #`-.*# contains=NERDTreePart,NERDTreeRO,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile syn match NERDTreeCWD #^[