diff --git a/README.markdown b/README.markdown index da7aaf6..27e5d9f 100644 --- a/README.markdown +++ b/README.markdown @@ -28,9 +28,9 @@ ## Release notes -+ V0.8.1 Incorporates yet antoher Fretep work : highlithing for tasks due today. ++ V0.8.1 Incorporates yet another Fretep work : highlighting for tasks due today. -+ v0.8 Incorporates Fretep's work on overdue dates (PR#13 and PR#16) witch ++ v0.8 Incorporates Fretep's work on overdue dates (PR#13 and PR#16) which removes python dependency, allow to control the cursor position after a sort by todo (see (sort)[#sort] and/or issue #15) and fixes bug when sorting a file containing only lines with due:date (issue #14). @@ -60,7 +60,7 @@ by David Beniamine. Todo.txt is a standard human readable todo notes file defined [here](http://todotxt.com): "The todo.txt format is a simple set of -[rules](https://github.com/ginatrapani/todo.txt-cli/wiki/The-Todo.txt-Format) +[rules](https://github.com/todotxt/todotxt/) that make todo.txt both human and machine-readable. The format supports priorities, creation and completion dates, projects and contexts. That's all you need to be productive. See an example Todo.txt file": @@ -77,7 +77,7 @@ all you need to be productive. See an example Todo.txt file": ### Why this fork ? This plugin is a fork of [freitass -todo.txt-vim](https://github.com/freitass/todo.txt-vim). It add severals cool +todo.txt-vim](https://github.com/freitass/todo.txt-vim). It add several cool functionalities including: + [Hierarchical sort](##hierarchical-sort) @@ -119,7 +119,7 @@ having copied the files. Then you will be able to get the commands help with: ## TodoTxt Files -This plugin provides a Flexible file naming for todo.txt, all the following +This plugin provides flexible file naming for todo.txt, all the following names are recognized as todo: YYYY-MM-[Tt]odo.txt @@ -200,7 +200,7 @@ For more information on the available flags see `help :sort` ## Mappings -By default todo-txt.vim set all the mappings secribed in this section. To +By default todo-txt.vim sets all the mappings described in this section. To prevent this behavior, add the following line to your vimrc let g:Todo_txt_do_not_map=1 @@ -214,13 +214,13 @@ prevent this behavior, add the following line to your vimrc + `s` : Sort the file by priority + `s+` : Sort the file on `+Projects` + `s@` : Sort the file on `@Contexts` -+ `sd` : Sort the file on due dates + `sc` : Sort the file by context then by priority + `scp` : Sort the file by context, project then by priority + `sp` : Sort the file by project then by priority + `spc` : Sort the file by project, context then by priority -+ `-sd` : Sort the file by due-date. Entries with a due date appears -sorted by at the beginning of the file, the rest of the file is not modified. ++ `sd` : Sort the file on due dates. Entries with a due date appear +sorted by at the beginning of the file, completed tasks are moved to the bottom and +the rest of the file is not modified. When you sort by due dates, at the end of the sort, your cursor will be placed at the top of the file. This behavior can be set with the following global diff --git a/autoload/todo.vim b/autoload/todo.vim index 73e1c16..fedb34f 100644 --- a/autoload/todo.vim +++ b/autoload/todo.vim @@ -3,7 +3,6 @@ " Author: David Beniamine , Peter (fretep) " Licence: Vim licence " Website: http://github.com/dbeniamine/todo.txt.vim -" vim: ts=4 sw=4 :help tw=78 cc=80 " These two variables are parameters for the successive calls the vim sort " '' means no flags @@ -30,7 +29,8 @@ function! todo#GetCurpos() return getpos('.') endfunction -" Increment and Decrement The Priority +" Increment and Decrement The Priority. +" TODO: Make nrformats local to buffers of type todo :set nf=octal,hex,alpha function! todo#PrioritizeIncrease() @@ -63,15 +63,14 @@ endfunction function! todo#PrependDate() if (getline(".") =~ '\v^\(') - execute "normal! 0f)a\\l\"=strftime(\"%Y-%m-%d\")\P" + execute "normal! 0f)a\\l\"=strftime(\"%Y-%m-%d\")\P" else - normal! 0"=strftime("%Y-%m-%d ") - P + normal! I=strftime("%Y-%m-%d ") endif endfunction function! todo#ToggleMarkAsDone(status) - if (getline(".") =~ 'x\s*\d\{4\}') + if (getline(".") =~ '\C^\s*x\s*\d\{4\}') :call todo#UnMarkAsDone(a:status) else :call todo#MarkAsDone(a:status) @@ -84,7 +83,7 @@ function! todo#UnMarkAsDone(status) else let pat=' '.a:status endif - exec ':s/\s*x\s*\d\{4}-\d\{1,2}-\d\{1,2}'.pat.'\s*//g' + exec ':s/\C^\s*x\s*\d\{4}-\d\{1,2}-\d\{1,2}'.pat.'\s*//g' endfunction function! todo#MarkAsDone(status) @@ -138,6 +137,7 @@ function! todo#Sort() " vim :sort is usually stable " we sort first on contexts, then on projects and then on priority if expand('%')=~'[Dd]one.*.txt' + " FIXME: Put some unit tests around this, and fix case sensitivity if ignorecase is set. silent! %s/\(x\s*\d\{4}\)-\(\d\{2}\)-\(\d\{2}\)/\1\2\3/g sort n /^x\s*/ silent! %s/\(x\s*\d\{4}\)\(\d\{2}\)/\1-\2-/g @@ -443,4 +443,4 @@ fun! todo#Complete(findstart, base) endif endfun - +" vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab foldmethod=marker diff --git a/autoload/todo/txt.vim b/autoload/todo/txt.vim index 3bac800..bad8d37 100644 --- a/autoload/todo/txt.vim +++ b/autoload/todo/txt.vim @@ -120,4 +120,4 @@ function! todo#txt#prioritize_add_action(priority) endfunction " Modeline {{{1 -" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1 +" vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab foldmethod=marker diff --git a/doc/todo.txt b/doc/todo.txt index 7242fb2..7854fa8 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -31,9 +31,9 @@ Table of Contents *TodoTxt-Contents* ~ =============================================================================== 1. Release notes *TodoTxt-ReleaseNotes* ~ -V0.8.1 Incorporates yet antoher Fretep work : highlithing for tasks due today. +V0.8.1 Incorporates yet another Fretep work : highlighting for tasks due today. -v0.8 Incorporates Fretep's work on overdue dates (PR#13 and PR#16) witch removes +v0.8 Incorporates Fretep's work on overdue dates (PR#13 and PR#16) which removes python dependency, allow to control the cursor position after a sort by todo (see |TodoTxt-Sort| and/or issue #15) and fixes bug when sorting a file containing only lines with due:date (issue #14). @@ -66,7 +66,7 @@ by David Beniamine. http://todotxt.com "The todo.txt format is a simple set of - rules(https://github.com/ginatrapani/todo.txt-cli/wiki/The-Todo.txt-Format) + rules(https://github.com/todotxt/todotxt/) that make todo.txt both human and machine-readable. The format supports priorities, creation and completion dates, projects and contexts. That's all you need to be productive. See an example Todo.txt file": @@ -83,7 +83,7 @@ by David Beniamine. 2.2 Why this fork ? *TodoTxt-Fork* This plugin is a fork of freitass todo.txt-vim - (https://github.com/freitass/todo.txt-vim). It add severals cool + (https://github.com/freitass/todo.txt-vim). It add several cool functionalities including: + Hierarchical sort: |TodoTxt-Sort| and |TodoTxt-HierarchicalSort|. @@ -126,7 +126,7 @@ by David Beniamine. =============================================================================== 3. TodoTxt Files *TodoTxt-Files* ~ -This plugin provides a Flexible file naming for todo.txt, all the following +This plugin provides a flexible file naming for todo.txt, all the following names are recognized as todo: > YYYY-MM-[Tt]odo.txt @@ -210,7 +210,7 @@ For more information on the available flags see |:sort| =============================================================================== 6. Mappings *TodoTxt-Mappings* ~ -By default todo-txt.vim set all the mappings secribed in this section. To +By default todo-txt.vim set all the mappings described in this section. To prevent this behavior, add the following line to your vimrc > let g:Todo_txt_do_not_map=1 @@ -224,8 +224,6 @@ prevent this behavior, add the following line to your vimrc `s@` : Sort the file on @Contexts - `sd` : Sort the file on due dates - `sc` : Sort the file by context then by priority `scp` : Sort the file by context, project then by priority @@ -234,8 +232,9 @@ prevent this behavior, add the following line to your vimrc `spc` : Sort the file by project, context then by priority - `-sd` : Sort the file by due-date. Entries with a due date appears - sorted by at the beginning of the file, the rest of the file is not modified. + `sd` : Sort the file on due dates. Entries with a due date appear + sorted by at the beginning of the file, completed tasks are moved to the bottom and + the rest of the file is not modified. When you sort by due dates, at the end of the sort, your cursor will be placed at the top of the file. This behavior can be set with the following global diff --git a/ftdetect/todo.vim b/ftdetect/todo.vim index d775f25..d73e589 100644 --- a/ftdetect/todo.vim +++ b/ftdetect/todo.vim @@ -3,7 +3,6 @@ " Author: David Beniamine , Leandro Freitas " License: Vim license " Website: http://github.com/dbeniamine/todo.txt-vim -" vim: ts=4 sw=4 :help tw=78 cc=80 autocmd BufNewFile,BufRead [Tt]odo.txt set filetype=todo autocmd BufNewFile,BufRead [Tt]odo-\d\\\{4\}-\d\\\{2\}-\d\\\{2\}.txt set filetype=todo @@ -17,3 +16,5 @@ autocmd BufNewFile,BufRead [Dd]one-\d\\\{4\}-\d\\\{2\}.txt set filetype=todo autocmd BufNewFile,BufRead \d\\\{4\}-\d\\\{2\}-\d\\\{2\}-[Dd]one.txt set filetype=todo autocmd BufNewFile,BufRead \d\\\{4\}-\d\\\{2\}-[Dd]one.txt set filetype=todo autocmd BufNewFile,BufRead [Dd]one-[Tt]oday.txt set filetype=todo + +" vim: tabstop=4 shiftwidth=4 softtabstop=4 expandtab foldmethod=marker diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index e4cd090..0f803b4 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -3,7 +3,6 @@ " Author: David Beniamine , Leandro Freitas " License: Vim license " Website: http://github.com/dbeniamine/todo.txt-vim -" vim: ts=4 sw=4 :help tw=78 cc=80 " Save context {{{1 let s:save_cpo = &cpo @@ -55,13 +54,13 @@ if !exists("g:Todo_txt_do_not_map") " Mark done {{{2 noremap