Added toggle for displaying symlink destination

This commit is contained in:
rzvxa 2023-09-05 06:16:01 +03:30
parent 32168889bd
commit a4e1a80680
3 changed files with 6 additions and 1 deletions

View File

@ -719,6 +719,9 @@ the NERDTree. These settings should be set in your vimrc, using `:let`.
|NERDTreeShowLineNumbers| Tells the NERDTree whether to display line |NERDTreeShowLineNumbers| Tells the NERDTree whether to display line
numbers in the tree window. 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 |NERDTreeSortOrder| Tell the NERDTree how to sort the nodes in the
tree. tree.

View File

@ -61,7 +61,8 @@ function! s:Path.cacheDisplayString() abort
let self.cachedDisplayString = self.addDelimiter(self.cachedDisplayString) . ' {' . join(self._bookmarkNames) . '}' let self.cachedDisplayString = self.addDelimiter(self.cachedDisplayString) . ' {' . join(self._bookmarkNames) . '}'
endif endif
if self.isSymLink " Show symlink destination if instructed to
if self.isSymLink && g:NERDTreeShowSymlinkDest
let self.cachedDisplayString = self.addDelimiter(self.cachedDisplayString) . ' -> ' . self.symLinkDest let self.cachedDisplayString = self.addDelimiter(self.cachedDisplayString) . ' -> ' . self.symLinkDest
endif endif

View File

@ -52,6 +52,7 @@ let g:NERDTreeShowFiles = get(g:, 'NERDTreeShowFiles', 1
let g:NERDTreeShowHidden = get(g:, 'NERDTreeShowHidden', 0) let g:NERDTreeShowHidden = get(g:, 'NERDTreeShowHidden', 0)
let g:NERDTreeShowLineNumbers = get(g:, 'NERDTreeShowLineNumbers', 0) let g:NERDTreeShowLineNumbers = get(g:, 'NERDTreeShowLineNumbers', 0)
let g:NERDTreeSortDirs = get(g:, 'NERDTreeSortDirs', 1) let g:NERDTreeSortDirs = get(g:, 'NERDTreeSortDirs', 1)
let g:NERDTreeShowSymlinkDest = get(g:, 'NERDTreeShowSymlinkDest', 1)
if !nerdtree#runningWindows() && !nerdtree#runningCygwin() if !nerdtree#runningWindows() && !nerdtree#runningCygwin()
let g:NERDTreeDirArrowExpandable = get(g:, 'NERDTreeDirArrowExpandable', '▸') let g:NERDTreeDirArrowExpandable = get(g:, 'NERDTreeDirArrowExpandable', '▸')