Add an :EditBookmarks command to edit the bookmarks file (#954)

* Add a new NERDTree buffer command to edit the bookmarks file.

* Update the mini-help panel with missing bookmark commands.

* Update the help file with the new :EditBookmarks command.
This commit is contained in:
Phil Runninger
2019-02-20 23:57:51 -05:00
committed by GitHub
parent f4d2b301b7
commit 2e0b101d57
4 changed files with 18 additions and 2 deletions

View File

@@ -156,6 +156,13 @@ function! s:Bookmark.delete()
call s:Bookmark.Write()
endfunction
" FUNCTION: s:Edit() {{{1
" opens the NERDTreeBookmarks file for manual editing
function! s:Bookmark.Edit()
execute "wincmd w"
execute "edit ".g:NERDTreeBookmarksFile
endfunction
" FUNCTION: Bookmark.getNode(nerdtree, searchFromAbsoluteRoot) {{{1
" Returns the tree node object associated with this Bookmark.
" Throws "NERDTree.BookmarkedNodeNotFoundError" if the node is not found.

View File

@@ -26,6 +26,7 @@ function! s:Creator._bindMappings()
command! -buffer -nargs=0 ClearAllBookmarks call g:NERDTreeBookmark.ClearAll() <bar> call b:NERDTree.render()
command! -buffer -nargs=0 ReadBookmarks call g:NERDTreeBookmark.CacheBookmarks(0) <bar> call b:NERDTree.render()
command! -buffer -nargs=0 WriteBookmarks call g:NERDTreeBookmark.Write()
command! -buffer -nargs=0 EditBookmarks call g:NERDTreeBookmark.Edit()
endfunction
" FUNCTION: s:Creator._broadcastInitEvent() {{{1

View File

@@ -119,6 +119,9 @@ function! s:UI._dumpHelp()
let help .= "\" :OpenBookmark <name>\n"
let help .= "\" :ClearBookmarks [<names>]\n"
let help .= "\" :ClearAllBookmarks\n"
let help .= "\" :ReadBookmarks\n"
let help .= "\" :WriteBookmarks\n"
let help .= "\" :EditBookmarks\n"
silent! put =help
elseif !self.isMinimal()
let help ="\" Press ". g:NERDTreeMapHelp ." for help\n"