Friday, August 27, 2010

Taskpaper vim script to insert @done tags


While I by no means think this will be WILDLY popular, screw it, I like it so I'm posting it here.

Perhaps you use the Taskpaper iPhone app. You want your notes everywhere so you sync your notes with Dropbox. You might even use a judicious symlink. I use a Notational Velocity fork and sync with that as well.

You might end up using Vim or MacVim to edit. You want to complete those notes using the @done(YYYY-mm-dd) tag.

And now you can with just one keypress! Insert this handy function in your .vimrc! And the @done tag with date will be inserted after the current line.

Oh my god this is niche.

But here it is:


:fu! Taskpaper()
:return setline(line("."), getline(line(".")) . "@done(" . strftime("%Y-%m-%d") . ")")
:endf
:map <F8> <ESC>:call Taskpaper()<CR><ESC>
:imap <F8> <ESC>:call Taskpaper()<CR><ESC>


love,
@themachackshack