A poor man's Notational Velocity/ResophNotes Vim alternative
Long time, no see. I haven’t touched this blog in almost two months and the reason for that is that life got in the way. I’ve really missed writing so I’ll defintively try to pick it up again, I swear!
Linux is in a lot of ways much better than Windows but for some reason there’s
no good alternative for note-taking apps like Notational
Velocity or
ResophNotes. I’ve tried
NvPY but unfortunately it doesn’t really work
that great for using plain text files with Dropbox. A couple of months back
I did experiment with using Vim in conjunction with the Ack
plugin, which worked fine on Linux but
rather poorly on Windows1. I decided to replace Ack with Vim’s
built-in grep
function, mainly just to keep it a cross-platform script. It’s
not quite as fast as Ack but the difference isn’t huge since it’s just dealing
with text files.
It basically consists of two command line mappings: Note
, which will create
a new in the specified notes folder with the provided filename and the default
extension, like this: :Note This is the filename
. Notes
has two functions.
You can either use it to browse the notes folder or search the content of the
text files in it, ie: :Notes I'm looking for this
. It’ll open up the quickfix
list after the search is complete.
I actually have a folder in my Vim home directory called tweaks
were I’ve
placed a few small changes but you could technically turn this into a real
plugin too or rewrite it and put it in your .vimrc
file. I like having most of
its’ functionality in a autoload
folder since it won’t load until you actually
need it.
tweaks/autoload/notes.vim:
There’s really nothing fancy in the above scripts, but the combination of using
netrw
, vimgrep
and the quickfix list works really well.
tweaks/plugin/notes.vim:
You can of course change the g:notes_directory
and g:notes_extension
to
whatever you want. You could remove the if has("unix")
part if you don’t plan
on using it on different systems too.
-
The plugin in itself works flawlessly but Ack doesn’t really work all to well on Windows. ↩