From af35c769ed9e188c169e81353fe9a95c0121dda1 Mon Sep 17 00:00:00 2001 From: David Beniamine Date: Fri, 10 Oct 2014 17:42:32 +0200 Subject: [PATCH] ADD: guards on mapping to avoid remappings --- plugin/todo-txt.vim | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugin/todo-txt.vim b/plugin/todo-txt.vim index 2faaabe..e5d88bb 100644 --- a/plugin/todo-txt.vim +++ b/plugin/todo-txt.vim @@ -21,11 +21,19 @@ if (! exists("g:Todo_txt_third_level_sort_mode")) endif " Sort todo by (first) context -noremap sc :call Todo_txt_HierarchicalSort('@', '', 1) -noremap scp :call Todo_txt_HierarchicalSort('@', '+', 1) +if !hasmapto("sc",'n') + noremap sc :call Todo_txt_HierarchicalSort('@', '', 1) +endif +if !hasmapto("scp",'n') + noremap scp :call Todo_txt_HierarchicalSort('@', '+', 1) +endif " Sort todo by (first) project -noremap sp :call Todo_txt_HierarchicalSort('+', '',1) -noremap spc :call Todo_txt_HierarchicalSort('+', '@',0) +if !hasmapto("sp",'n') + noremap sp :call Todo_txt_HierarchicalSort('+', '',1) +endif +if !hasmapto("spc",'n') + noremap spc :call Todo_txt_HierarchicalSort('+', '@',0) +endif " This is a Hierarchical sort designed for todo.txt todo lists, however it " might be used for other files types