diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index 132f9c9..957060b 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -64,10 +64,18 @@ function! TodoTxtRemoveCompleted() call s:AppendToFile(l:done_file, l:completed) endfunction +function! TodoTxtSort() + " vim :sort is usually stable + " we sort first on contexts, then on projects and then on priority + :sort /@[a-zA-Z]*/ r + :sort /+[a-zA-Z]*/ r + :sort /\v\([A-Z]\)/ r +endfunction + " Mappings {{{1 " Sort tasks {{{2 if !hasmapto("s",'n') - nnoremap