diff --git a/lib/nerdtree/bookmark.vim b/lib/nerdtree/bookmark.vim index dd69ad0..55abc8c 100644 --- a/lib/nerdtree/bookmark.vim +++ b/lib/nerdtree/bookmark.vim @@ -343,6 +343,12 @@ function! s:Bookmark.Write() for j in s:Bookmark.InvalidBookmarks() call add(bookmarkStrings, j) endfor + + let path = fnamemodify(g:NERDTreeBookmarksFile, ':h') + if !isdirectory(path) + call mkdir(path, 'p') + endif + call writefile(bookmarkStrings, g:NERDTreeBookmarksFile) endfunction