mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 03:43:50 -05:00
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:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user