From 471a03c9d91615f58f26206d284c57f58b0a1376 Mon Sep 17 00:00:00 2001 From: Jason Franklin Date: Sat, 10 Jun 2017 17:07:57 -0400 Subject: [PATCH 1/2] Implement the g:NERDTreeMarkBookmarks setting The setting is self-explanatory. See the added documentation for further details. --- doc/NERD_tree.txt | 9 +++++++++ lib/nerdtree/path.vim | 2 +- plugin/NERD_tree.vim | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/NERD_tree.txt b/doc/NERD_tree.txt index d50cfb2..cc040d1 100644 --- a/doc/NERD_tree.txt +++ b/doc/NERD_tree.txt @@ -845,6 +845,15 @@ If set to 0, the bookmarks list is not sorted. If set to 1, the bookmarks list is sorted in a case-insensitive manner. If set to 2, the bookmarks list is sorted in a case-sensitive manner. +------------------------------------------------------------------------------ + *'NERDTreeMarkBookmarks'* +Values: 0 or 1 +Default: 1 + +If set to 1, Bookmarks will be specially marked whenever the NERDTree is +rendered. Users of the |'NERDTreeMinimalUI'| setting may prefer to disable +this setting for even less visual clutter. + ------------------------------------------------------------------------------ *'NERDTreeMouseMode'* Values: 1, 2 or 3. diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim index 6f48a18..805e4a6 100644 --- a/lib/nerdtree/path.vim +++ b/lib/nerdtree/path.vim @@ -52,7 +52,7 @@ function! s:Path.cacheDisplayString() abort call add(self._bookmarkNames, i.name) endif endfor - if !empty(self._bookmarkNames) + if !empty(self._bookmarkNames) && g:NERDTreeMarkBookmarks == 1 let self.cachedDisplayString .= ' {' . join(self._bookmarkNames) . '}' endif diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 451b431..5960d0b 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -57,6 +57,7 @@ call s:initVariable("g:NERDTreeBookmarksFile", expand('$HOME') . '/.NERDTreeBook call s:initVariable("g:NERDTreeBookmarksSort", 1) call s:initVariable("g:NERDTreeHighlightCursorline", 1) call s:initVariable("g:NERDTreeHijackNetrw", 1) +call s:initVariable('g:NERDTreeMarkBookmarks', 1) call s:initVariable("g:NERDTreeMouseMode", 1) call s:initVariable("g:NERDTreeNotificationThreshold", 100) call s:initVariable("g:NERDTreeQuitOnOpen", 0) From 9b3487db64c6888c6f03ebadc45084ec339b64e3 Mon Sep 17 00:00:00 2001 From: Jason Franklin Date: Sun, 11 Jun 2017 09:47:50 -0400 Subject: [PATCH 2/2] Update the option summary It came to my attention that the option summary has been neglected for the past few commits. I added the new option in this feature branch and updated the descriptions of two nearby options. This section could use some focused editing. --- doc/NERD_tree.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/NERD_tree.txt b/doc/NERD_tree.txt index cc040d1..3b9f628 100644 --- a/doc/NERD_tree.txt +++ b/doc/NERD_tree.txt @@ -637,11 +637,11 @@ NERD tree. These options should be set in your vimrc. |'NERDTreeBookmarksFile'| Where the bookmarks are stored. -|'NERDTreeBookmarksSort'| Whether the bookmarks list is sorted on - display. +|'NERDTreeBookmarksSort'| Control how the Bookmark table is sorted. -|'NERDTreeMouseMode'| Tells the NERD tree how to handle mouse - clicks. +|'NERDTreeMarkBookmarks'| Render bookmarked nodes with markers. + +|'NERDTreeMouseMode'| Manage the interpretation of mouse clicks. |'NERDTreeQuitOnOpen'| Closes the tree window after opening a file.