nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 34630f3926eccd35c7c2ae23dd315f67557cde3b
parent 0b44415a3302030b56755cc1135ca9ca57dc1ada
Author: hiberabyss <lhbf@qq.com>
Date:   Sun, 20 Sep 2015 00:53:39 +0800

issue #147: add support to ~ expand in bookmarks

Diffstat:
Mlib/nerdtree/bookmark.vim | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git 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