mirror of
https://github.com/freitass/todo.txt-vim.git
synced 2025-11-17 06:13:38 -05:00
Sorting tasks by date.
This commit is contained in:
@@ -89,6 +89,10 @@ function! TodoTxtSortByProject() range
|
||||
function! TodoTxtSortByProject() range
|
||||
execute a:firstline . "," . a:lastline . "sort /\\(^\\| \\)\\zs+[^[:blank:]]\\+/ r"
|
||||
endfunction
|
||||
|
||||
function! TodoTxtSortByDate() range
|
||||
execute a:firstline . "," . a:lastline . "sort! /\\d\\{2,4\\}-\\d\\{2\\}-\\d\\{2\\}/ r"
|
||||
endfunction
|
||||
|
||||
" Mappings {{{1
|
||||
" Sort tasks {{{2
|
||||
@@ -115,6 +119,14 @@ if !hasmapto("<leader>s+",'v')
|
||||
if !hasmapto("<leader>s+",'v')
|
||||
vnoremap <script> <silent> <buffer> <leader>s+ :call TodoTxtSortByProject()<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<leader>sd",'n')
|
||||
nnoremap <script> <silent> <buffer> <leader>sd :%call TodoTxtSortByDate()<CR>
|
||||
endif
|
||||
|
||||
if !hasmapto("<leader>sd",'v')
|
||||
vnoremap <script> <silent> <buffer> <leader>sd :call TodoTxtSortByDate()<CR>
|
||||
endif
|
||||
|
||||
" Increment and Decrement The Priority
|
||||
:set nf=octal,hex,alpha
|
||||
|
||||
Reference in New Issue
Block a user