From 34630f3926eccd35c7c2ae23dd315f67557cde3b Mon Sep 17 00:00:00 2001 From: hiberabyss Date: Sun, 20 Sep 2015 00:53:39 +0800 Subject: [PATCH] issue #147: add support to ~ expand in bookmarks --- lib/nerdtree/bookmark.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nerdtree/bookmark.vim b/lib/nerdtree/bookmark.vim index 8a94b25..91648d2 100644 --- a/lib/nerdtree/bookmark.vim +++ b/lib/nerdtree/bookmark.vim @@ -87,6 +87,7 @@ function! s:Bookmark.CacheBookmarks(silent) let name = substitute(i, '^\(.\{-}\) .*$', '\1', '') let path = substitute(i, '^.\{-} \(.*\)$', '\1', '') + let path = fnamemodify(path, ':p') try let bookmark = s:Bookmark.New(name, g:NERDTreePath.New(path)) @@ -304,7 +305,7 @@ endfunction function! s:Bookmark.Write() let bookmarkStrings = [] for i in s:Bookmark.Bookmarks() - call add(bookmarkStrings, i.name . ' ' . i.path.str()) + call add(bookmarkStrings, i.name . ' ' . fnamemodify(i.path.str(), ':~')) endfor "add a blank line before the invalid ones