Note-taking with Vim

Two vim posts in one day!

My task list at work has recently become so large (it's probably well over a year's worth of work now) that I now need to track my tasks somewhere other than in my head (documentation is always better than tribal knowledge anyways). I realy don't like task tracking becuase most of the applications out there are just so heavy for what note-taking actually is. I use vim almost all day, every day though, so why not use that (plus it's command line!)?

I spent about thirty minutes writing this up today. It's inspired a bit by the LifeHacker article, Turn Your Command Line into a Fast and Simple Note Taking Tool (thanks Jack Mottram).

This will automagically give all of your notes a .wiki extension, telling vim to use the mediawiki text syntax highlighter (I use MediaWiki a lot to so I figured I'd use that syntax for markup). This can be found here. If you want to use something else like markdown, just change the $noteExt variable at the top to the extension associated with the highlighter you want.

This addition will give you six new commands.
 * : Opens a note for editing or creates a new note. If no note is specified, opens the most recent note.
 * : Appends text to the requested note.
 * : Prints the contents of the specified note.
 * : Lists all notes by date modified
 * : Searches all notes for the search term (case insensitive) and prints the results along with note title and line number on which the term was found.
 * : Renames a note
 * : Deletes the specified note.

Add the following to your .bash_profile (or .profile if you're a ksh user)