From a4e1a806806d3de64a221412aef0f6a1d320992f Mon Sep 17 00:00:00 2001 From: rzvxa Date: Tue, 5 Sep 2023 06:16:01 +0330 Subject: [PATCH] Added toggle for displaying symlink destination --- doc/NERDTree.txt | 3 +++ lib/nerdtree/path.vim | 3 ++- plugin/NERD_tree.vim | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/NERDTree.txt b/doc/NERDTree.txt index a2a7a469..caa20f76 100644 --- a/doc/NERDTree.txt +++ b/doc/NERDTree.txt @@ -719,6 +719,9 @@ the NERDTree. These settings should be set in your vimrc, using `:let`. |NERDTreeShowLineNumbers| Tells the NERDTree whether to display line numbers in the tree window. +|NERDTreeShowSymlinkDest| Tells the NERDTree whether to display symlinks + destination path or display it as a normal node + |NERDTreeSortOrder| Tell the NERDTree how to sort the nodes in the tree. diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim index 997abf37..75942fbd 100644 --- a/lib/nerdtree/path.vim +++ b/lib/nerdtree/path.vim @@ -61,7 +61,8 @@ function! s:Path.cacheDisplayString() abort let self.cachedDisplayString = self.addDelimiter(self.cachedDisplayString) . ' {' . join(self._bookmarkNames) . '}' endif - if self.isSymLink + " Show symlink destination if instructed to + if self.isSymLink && g:NERDTreeShowSymlinkDest let self.cachedDisplayString = self.addDelimiter(self.cachedDisplayString) . ' -> ' . self.symLinkDest endif diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index ef60cca1..fd9cd16c 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -52,6 +52,7 @@ let g:NERDTreeShowFiles = get(g:, 'NERDTreeShowFiles', 1 let g:NERDTreeShowHidden = get(g:, 'NERDTreeShowHidden', 0) let g:NERDTreeShowLineNumbers = get(g:, 'NERDTreeShowLineNumbers', 0) let g:NERDTreeSortDirs = get(g:, 'NERDTreeSortDirs', 1) +let g:NERDTreeShowSymlinkDest = get(g:, 'NERDTreeShowSymlinkDest', 1) if !nerdtree#runningWindows() && !nerdtree#runningCygwin() let g:NERDTreeDirArrowExpandable = get(g:, 'NERDTreeDirArrowExpandable', '▸')