« Back to home

Manage your ToDo list with Vim

Posted on

I'm still looking for the perfect tool to manage my ToDo lists. I tried a lot of different things: wiki, spreadsheet, online web2.0 apps, emails, ..., I always came back to my plain text file. With the time, I added some Vim shortcuts to make the editing easier. This is not perfect, I know it's possible to do better things with Vim. Vim experts, comments are welcome :-)

Here is my tip:

I keep a list of tasks formatted like this (one task per line) :

priority - cat1 - cat2 - task description

and use the following mapping:

map <F1> 5<C-X>
map <F2> 5<C-A>
map <F3> :.s/^\d\+/99 - _done/<CR>:noh<CR>
map <F4> :%!sort -b -n -k 1<CR>
map <F5> :%!sort -b -f -k 2<CR>

F1 and F2 decreases and increases the priority number by 5 (you need to have the cursor on the number)

F4 sorts the list by priority

F5 sorts the list by the first category

If you have finished a task, you can delete the line, or hit F3 that set the priority to 99 and the first category to _done (these tasks will always be listed at the end of the list)