Vim Outliner for task management

To organise my tasks, I have defined some handy shortcuts in vim to quickly add a new TODO line, and to jump to the next item with a given priority. Just add the following lines to your .vimrc:

" Search helpers for finding unfinished tasks, by priority
au FileType vo_base nmap <buffer><silent><leader>1 gg/^\s*\[_\]\ P1.*<cr>
au FileType vo_base nmap <buffer><silent><leader>2 gg/^\s*\[_\]\ P2.*<cr>
au FileType vo_base nmap <buffer><silent><leader>3 gg/^\s*\[_\]\ P3.*<cr>
au FileType vo_base nmap <buffer><silent><leader>4 gg/^\s*\[_\]\ P4.*<cr>

" Helpers for creating new tasks (yep, trailing space is intentional)
au FileType vo_base imap <buffer><silent><leader>1 [_] P1
au FileType vo_base imap <buffer><silent><leader>2 [_] P2
au FileType vo_base imap <buffer><silent><leader>3 [_] P3
au FileType vo_base imap <buffer><silent><leader>4 [_] P4

What it does is this: If you’re in normal mode, <leader>1 finds the topmost task with priority 1 (which by my convention is a checkbox item with the prefix “P1”). <leader>, as you might know, is usually mapped to comma, but may be set to something else with :let mapleader=…. The same works for priorities up to 4, but you could easily extend it even further.

The second group of autocommands is for insert mode, to simply add another P1, P2, P3, or P4 entry.