ADD: guards on mapping to avoid remappings

This commit is contained in:
David Beniamine
2014-10-10 17:42:32 +02:00
parent c0a6726696
commit af35c769ed

View File

@@ -21,11 +21,19 @@ if (! exists("g:Todo_txt_third_level_sort_mode"))
endif endif
" Sort todo by (first) context " Sort todo by (first) context
if !hasmapto("<localleader>sc",'n')
noremap <localleader>sc :call Todo_txt_HierarchicalSort('@', '', 1)<CR> noremap <localleader>sc :call Todo_txt_HierarchicalSort('@', '', 1)<CR>
endif
if !hasmapto("<localleader>scp",'n')
noremap <localleader>scp :call Todo_txt_HierarchicalSort('@', '+', 1)<CR> noremap <localleader>scp :call Todo_txt_HierarchicalSort('@', '+', 1)<CR>
endif
" Sort todo by (first) project " Sort todo by (first) project
if !hasmapto("<localleader>sp",'n')
noremap <localleader>sp :call Todo_txt_HierarchicalSort('+', '',1)<CR> noremap <localleader>sp :call Todo_txt_HierarchicalSort('+', '',1)<CR>
endif
if !hasmapto("<localleader>spc",'n')
noremap <localleader>spc :call Todo_txt_HierarchicalSort('+', '@',0)<CR> noremap <localleader>spc :call Todo_txt_HierarchicalSort('+', '@',0)<CR>
endif
" This is a Hierarchical sort designed for todo.txt todo lists, however it " This is a Hierarchical sort designed for todo.txt todo lists, however it
" might be used for other files types " might be used for other files types