Todo list management with vim
Like many people I am using a GTD based system for management of the
things I have todo. My calendar is based on a Palm Treo 650 with datebk6. My
todolist is however not on my Palm, but is edited with vim. Within Vim
I use folds to easily move contexts more or less out of view when the context
is not relevant to my current situation.
The text file format
The fileformat for my todolist is quit simple.
The file starts with an $Id: todo_list_management_with_vim.m4 2194 2008-06-27 20:09:03Z jnieuwen $ tag for the subversion
version management the todolist file is in. Subversion simplifies
the moving of my todolist between computers.
A todo item is registered as:
- :
When an todo item is completed I just delete it from the
file with something like the dd command.
A waiting for item is inserted as:
- wait: (year-month-day)
The year-month-day part is used to register the date I started to wait for the
item. This makes it easier to see if a follow up from me is needed to get
things rolling again when things get stalled. As with todo items,
when a waiting for item is no longer relevant it is removed from the file.
Taking care of the folds
The most interesting part probably is the to make sure I
have the correct folds. For that I have the following rules
in my .vimrc file:
autocmd BufRead /path/to/todo.txt set number
With this rule all lines have numbers. This is mainly
for my convenience.
autocmd BufRead /path/to/todo.txt set foldmethod=marker
This line sets the foldmethod to marker. Which means that
a fold is started on every line which ends with {{{1.
Where 1 is the fold level. But for my todo list I only use level 1.
autocmd BufRead /path/to/todo.txt %!addfolds.pl
addfolds.pl is the script where the real magic happens. This scripts
adds the {{{1 in the correct places and removes the {{{1 from the
incorrect places.
autocmd BufRead /path/to/todo.txt %foldopen
This line makes sure that all folds are open when vim is started
on the todo file.
An supplement to this article can be found on my
blog.
|