Skip to content

Instantly share code, notes, and snippets.

@kennyp
Created March 29, 2011 06:08
Show Gist options
  • Save kennyp/891877 to your computer and use it in GitHub Desktop.
Save kennyp/891877 to your computer and use it in GitHub Desktop.
Find todos under current directory.
function! s:ToDoList ()
cclose
let task_list = []
for row in split(system('ack --column "(TODO|CHANGED|FIXME)"'), '\n')
let t = split(row, ':')
let task_dict = {'filename': t[0], 'lnum': t[1], 'col': t[2]}
let task_dict.text = substitute(join(t[3:-1]), '\s\+', ' ', '')
let task_list += [task_dict]
endfor
call setqflist(task_list, 'r')
copen
endfunction
command! ToDoList call <SID>ToDoList()
map <silent> <Leader>td :ToDoList<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment