xolox / vim-notes

Easy note taking in Vim
http://peterodding.com/code/vim/notes/
1.6k stars 110 forks source link

can't get rid of "phantom" note #41

Closed elliottw closed 11 years ago

elliottw commented 11 years ago
Error detected while processing function xolox#notes#edit:
line   24:
E484: Can't open file /Users/elliottw/dotfiles/vim/bundle/vim-notes/misc/notes/shadow/New note
Press ENTER or type command to continue
xolox commented 11 years ago

How did you install the plug-in? And did you delete the file or not?

elliottw commented 11 years ago

I moved the files from one location to another. Then I saw a "New note" that was still somehow pointing to the old location. I just did ":IndexTaggedNotes" and it seems to have fixed the problem.

elliottw commented 11 years ago

mac 10.8.4 vim 7 and vim version 7.3.390 iTerm2

ok, found it again, despite the indexing. When creating a new note from within vim i get:

"~/Dropbox/text/@CatapultPGH" [New File]
Error detected while processing function xolox#notes#edit:
line   24:
E484: Can't open file /Users/elliottw/dotfiles/vim/bundle/vim-notes/misc/notes/shadow/New note
Press ENTER or type command to continue
xolox commented 11 years ago

The files in the directory misc/notes/shadow belong with the plug-in and shouldn't be modified or deleted. If you move that directory outside of the directory containing the plug-in, it will get confused. If you insist on moving those files somewhere else, you should set the variable g:notes_shadowdir in your ~/.vimrc script, so that the plug-in knows where to find the directory. I hope this helps :-)


If it doesn't help, there's one other thing I can think of: When you moved the files, you missed some. Assuming the original location was under ~/.vim, you should remove all of the following files:

elliottw commented 11 years ago

I never manually moved any files, but I did do this: :let g:notes_directories to setup a directory in my Dropbox folder. I am assuming that the New Note file existed before I changed that option.

xolox commented 11 years ago

Earlier you said:

I moved the files from one location to another.

I assumed your were talking about the files installed by the Vim plug-in (the Vim scripts, the shadow directory, etc.). But now it seems like you didn't:

I never manually moved any files, but I did do this: ...

So now I'm confused? The shadow note New note is definitely included in the code base (I and a couple hundred users would have noticed otherwise :-p) and I don't think the plug-in would ever delete any of the notes in the shadow directory. So it should be there.

The only reason I can think of that this breaks is confusion about the installation directory. Judging by the messages you've posted, I assume you now have the plug-in installed using Pathogen, inside your Dropbox? And this is the only place where it's installed? Can you execute the following Vim command and report the output here?

call confirm(join(["Debugging info about vim-notes:", "", printf('The option g:notes_directories is set to %s.', string(g:notes_directories)), printf('The option g:notes_shadowdir is set to %s.', string(g:notes_shadowdir)), printf('Does the directory with shadow notes exist? %s.', isdirectory(expand(g:notes_shadowdir)) ? "Yes" : "No"), printf('Does the "New note" template exist? %s.', filereadable(xolox#misc#path#merge(expand(g:notes_shadowdir), 'New note')) ? "Yes" : "No"), printf("Vim's runtimepath is set to %s.", string(&rtp))], "\n"))

It's a very long expression on a single line, I did that on purpose so you can easily copy/paste it to Vim's command line :-)

elliottw commented 11 years ago

I'm terribly sorry about being so unclear. I used pathogen and installed the vim-notes into ~/.vim/bundle I then started playing around with the plugin i think set the note directory to one in dropbox.

Here is the output from the command:

:call confirm(join(["Debugging info about vim-notes:", "", printf('The option g:notes_directori
Debugging info about vim-notes:es_directories)), printf('The option g:notes_shadowdir is set to
 %s.', string(g:notes_shadowdir)), printf('Does the directory with shadow notes exist? %s.', is
The option g:notes_directories is set to ['~/Dropbox/text'].('Does the "New note" template exis
The option g:notes_shadowdir is set to '/Users/elliottw/dotfiles/vim/bundle/vim-notes/misc/note
s/shadow'.tf("Vim's runtimepath is set to %s.", string(&rtp))], "\n"))
Does the directory with shadow notes exist? Yes.
Does the "New note" template exist? No.
Vim's runtimepath is set to '/Users/elliottw/.vim,/Users/elliottw/.vim/bundle/VimClojure,/Users
/elliottw/.vim/bundle/command-t,/Users/elliottw/.vim/bundle/nerdtree,/Users/elliottw/.vim/bundl
e/old,/Users/elliottw/.vim/bundle/rainbow_parentheses.vim,/Users/elliottw/.vim/bundle/supertab,
/Users/elliottw/.vim/bundle/vim-colors-solarized,/Users/elliottw/.vim/bundle/vim-json,/Users/el
liottw/.vim/bundle/vim-markdown,/Users/elliottw/.vim/bundle/vim-marked,/Users/elliottw/.vim/bun
dle/vim-misc,/Users/elliottw/.vim/bundle/vim-notes,/Users/elliottw/.vim/bundle/vim-shell,/Users
/elliottw/.vim/bundle/vim-signature,/Users/elliottw/.vim/bundle/vimwiki,/usr/share/vim/vimfiles
,/usr/share/vim/vim73,/usr/share/vim/vimfiles/after,/Users/elliottw/.vim/bundle/vim-markdown/af
ter,/Users/elliottw/.vim/after'.
[O]k:
xolox commented 11 years ago

I have two comments based on the output you posted:

  1. You say you installed vim-notes into ~/.vim/bundle but I also see ~/dotfiles/vim/bundle/vim-notes in the output you posted. Is there a symbolic link involved? If not, please make sure you have the plug-in installed in exactly one location.
  2. The output you posted includes this:

    Does the directory with shadow notes exist? Yes.
    Does the "New note" template exist? No.

    That is to say, the directory exists but does not contain the file New note even though it should. I may be missing something, but I would suggest to simply try a clean reinstall of the plug-in. This will make sure the file is restored. After that, see if the problem reappears. It shouldn't, because I honestly don't see how it can; it works fine for me and all other users of the plug-in (as far as I know).

elliottw commented 11 years ago

I'm lame. Sorry, I do keep my dotfiles in a different place and then symlink. I'll reinstall. Sorry for all the confusion.

I recreated New note in the shadow directory and everything seems to be working fine. If I run into another issue, I'll try a clean install before anything else.