diff --git a/autoload/todo/txt.vim b/autoload/todo/txt.vim index 0232488..efd72df 100644 --- a/autoload/todo/txt.vim +++ b/autoload/todo/txt.vim @@ -93,6 +93,12 @@ function! todo#txt#sort_by_date() range execute a:firstline . "," . a:lastline . "g!/" . l:date_regex . "/m" . a:lastline endfunction +function! todo#txt#sort_by_due_date() range + let l:date_regex = "due:\\d\\{2,4\\}-\\d\\{2\\}-\\d\\{2\\}" + execute a:firstline . "," . a:lastline . "sort /" . l:date_regex . "/ r" + execute a:firstline . "," . a:lastline . "g!/" . l:date_regex . "/m" . a:lastline +endfunction + " Increment and Decrement The Priority :set nf=octal,hex,alpha diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index 65252db..548617b 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -26,6 +26,8 @@ nnoremap