diff --git a/README.markdown b/README.markdown index 111e23d..9970ba9 100644 --- a/README.markdown +++ b/README.markdown @@ -182,6 +182,13 @@ 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 +prevent this behavior, add the following line to your vimrc + + let g:Todo_txt_do_not_map=1 + + + `` is \ by default, so ̀`-s` means you type \s ### Sort diff --git a/autoload/todo.vim b/autoload/todo.vim index 3e9c98c..b5808bc 100644 --- a/autoload/todo.vim +++ b/autoload/todo.vim @@ -84,7 +84,7 @@ function! todo#MarkAsDone(status) endfunction function! todo#MarkAllAsDone() - :g!/^x /:call todo#MarkAsDone() + :g!/^x /:call todo#MarkAsDone('') endfunction function! s:AppendToFile(file, lines) diff --git a/doc/todo.txt b/doc/todo.txt index d0e8f6c..bb2498d 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -191,6 +191,12 @@ 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 +prevent this behavior, add the following line to your vimrc +> + let g:Todo_txt_do_not_map=1 +< + 6.1 Sort *TodoTxt-Sort* `s` : Sort the file by priority diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index 9fec984..c76d0c4 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -19,139 +19,50 @@ setlocal wrapmargin=0 " Mappings {{{1 +if !exists("g:Todo_txt_do_not_map") " Sort todo by (first) context -if !hasmapto("sc",'n') noremap sc :call todo#HierarchicalSort('@', '', 1) -endif -if !hasmapto("scp",'n') - noremap scp :call todo#HierarchicalSort('@', '+', 1) -endif -" Sort todo by (first) project -if !hasmapto("sp",'n') - noremap sp :call todo#HierarchicalSort('+', '',1) -endif -if !hasmapto("spc",'n') - noremap spc :call todo#HierarchicalSort('+', '@',1) -endif + noremap scp :call todo#HierarchicalSort('@', '+', 1) +" Sort todo by (first) project + noremap sp :call todo#HierarchicalSort('+', '',1) + noremap spc :call todo#HierarchicalSort('+', '@',1) " Sort tasks {{{2 -if !hasmapto("s",'n') nnoremap