From 1cc11c56ada57bc6e727e22a46a5f2bff62ccf24 Mon Sep 17 00:00:00 2001 From: Leandro Freitas Date: Thu, 16 Apr 2015 20:47:53 -0300 Subject: [PATCH] Sorting tasks by date. --- ftplugin/todo.vim | 12 ++++++++++++ test/tc_sort_date.todo.txt | 5 +++++ test/tc_sort_date.vim | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 test/tc_sort_date.todo.txt create mode 100644 test/tc_sort_date.vim diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index 099e5a2..fe2afbe 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -89,6 +89,10 @@ 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 if !hasmapto("s",'n') @@ -115,6 +119,14 @@ if !hasmapto("s+",'v') vnoremap