Merge branch 'master' of https://github.com/matjon/todo.txt-vim
Conflicts: ftplugin/todo.vim
This commit is contained in:
@@ -76,10 +76,18 @@ function! TodoTxtRemoveCompleted()
|
||||
:g/^x /call add(l:completed, getline(line(".")))|d
|
||||
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("<localleader>s",'n')
|
||||
if !hasmapto("<localleader>s",'n')
|
||||
nnoremap <script> <silent> <buffer> <leader>s :call TodoTxtSort()<CR>
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user