last fix for sorting due dates
This commit is contained in:
@@ -72,6 +72,14 @@ function! TodoTxtToggleComplete()
|
|||||||
exec "s/^/x " . strftime('%Y-%m-%d') . " /"
|
exec "s/^/x " . strftime('%Y-%m-%d') . " /"
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! TodoTxtSortDue()
|
||||||
|
:silent! %s/\(due:\d\{4}\)-\(\d\{2}\)-\(\d\{2}\)/\1\2\3/g
|
||||||
|
:sort n /due:/
|
||||||
|
:silent! %s/\(due:\d\{4}\)/\1-/g
|
||||||
|
:silent! %s/\(due:\d\{4}-\d\{2}\)/\1-/g
|
||||||
|
" TODO: add time sorting (YYYY-MM-DD HH:MM)
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Mappings {{{1
|
" Mappings {{{1
|
||||||
" Sort tasks {{{2
|
" Sort tasks {{{2
|
||||||
@@ -185,7 +193,7 @@ endif
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Sort @_sched by due: date {{{2
|
" Sort @_sched by due: date {{{2
|
||||||
if !hasmapto("<leader>sd".'n')
|
if !hasmapto("<leader>sd".'n')
|
||||||
nnoremap <script> <silent> <buffer> <leader>sd :call TodoTxtSortDue()<CR>
|
nnoremap <script> <silent> <buffer> <leader>sd :call TodoTxtSortDue()<CR>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user