开发者

NERDTree can't write a bookmark to a file

开发者 https://www.devze.com 2023-03-24 05:29 出处:网络
When I try to create a bookmark in NERDTree (win7 with emacs installed) :Bookmark mybookmark 开发者_如何学JAVAI get this:

When I try to create a bookmark in NERDTree (win7 with emacs installed)

:Bookmark mybookmark
开发者_如何学JAVA

I get this:

E482: Can't create file C:\emacs\home/.NERDTreeBookmarks


NERDTree is trying to write the bookmark to "$HOME/.NERDTreeBookmarks" by default. This is how it looks like in the code:

call s:initVariable("g:NERDTreeBookmarksFile", expand('$HOME') . '/.NERDTreeBookmarks')

While it's possible that you've set the "g:NERDTreeBookmarksFile" variable somewhere in the configuration, it's a lot more likely that emacs has, for some reason, set your "HOME" environment variable to "C:\emacs\home". This explains the slash/backslash mixup as well. You can try two things:

  • Change the $HOME variable to your home dir, "C:\Users\your-username". A quick google turns up this guide for windows 7: http://www.itechtalk.com/thread3595.html
  • Just set the "g:NERDTreeBookmarksFile" variable to your home dir ("C:\Users\your-username").

I'd recommend the second option, since it's definitely going to work. You may need to escape the backslashes and spaces, but I can't be sure how at the moment. Try it out in all of these ways and see which one works for you:

let g:NERDTreeBookmarksFile = "C:\Users\Your\ Username"
let g:NERDTreeBookmarksFile = "C:\\Users\\Your\ Username"
let g:NERDTreeBookmarksFile = 'C:\Users\Your Username'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号