xolox / vim-notes

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

Feature request: Don't use a centralized dictionary for notes #75

Closed nathschwarz closed 10 years ago

nathschwarz commented 10 years ago

It'd be neat to be able to deactivate the centralized dictionary or force write/read a note-file in the pwd/given path.

This way a note-file could be distributed (e.g. in a project with git) much more easily.

xolox commented 10 years ago

Hi and thanks for the feedback! To explain my answer to your feature request (see below) requires some historical perspective:

  1. The vim-notes plug-in started out with a single directory which was all I needed.
  2. Then users requested support for multiple directories so I added that (eventually, after enough e-mails and GitHub issues).
  3. Then users requested support for recursive handling of directories so I added that (again, eventually, after enough e-mails and GitHub issues).

Basically things have already gotten way more complex than I would like them so I'm certainly not looking forward to making things even more complex. However, the vim-notes plug-in has gotten quite flexible over the years so it might already do what you want it to do:

  1. If you have mode lines enabled in Vim you can add the line vim: ft=notes at the bottom of a file and it will be highlighted as a note. I frequently use this feature myself without any problems.
  2. You can do more or less the same thing by adding some magic to your Vim profile, e.g. you can automatically set the notes file type for all files with a certain filename pattern (directory, extension, whatever you like) or a specific piece of content within files.

Features like :SearchNotes will not work if you use either of the options above because the vim-notes plug-in is of course not going to scan your complete file system for "files that look like notes". It also doesn't have a persistent memory of "files that were previously opened with the notes file type" (and I'm not going to add this :-).

Does either of the above points answer your question? If you're interested in option 2 I can explain in more detail how to do that, but then I need to understand exactly what it is that you are trying to accomplish.

nathschwarz commented 10 years ago

Thanks for the extensive reply! After reading your reply I consulted the help of vim and got it to work nicely - I already had setup '.note' as fileextension and added the line 'au BufNewFile,BufRead *.note set filetype=notes' to my vimrc, which now opens all note-files correctly. Edit: I guess this is what you intended with option two, nor?

Thanks again and thanks for this great plugin!

xolox commented 10 years ago

I'm glad you found a solution that works for you :-). I'm closing this issue now because I believe you found what you're looking for. If not then feel free to reopen this issue. Happy Vimming!