diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index b274095..099e5a2 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -81,18 +81,38 @@ function! TodoTxtRemoveCompleted() call s:AppendToFile(l:done_file, l:completed) endfunction +function! TodoTxtSortByContext() range + execute a:firstline . "," . a:lastline . "sort /\\(^\\| \\)\\zs@[^[:blank:]]\\+/ r" +endfunction + +function! TodoTxtSortByProject() range + execute a:firstline . "," . a:lastline . "sort /\\(^\\| \\)\\zs+[^[:blank:]]\\+/ r" +endfunction + " Mappings {{{1 " Sort tasks {{{2 if !hasmapto("s",'n') - nnoremap