Skip to content

Commit 6b6c4b3

Browse files
committed
Adds a custom mappings option for item management commands (#3)
A global variable 'g:VimTodoListsCustomKeyMapper' added that supposed to contain a name of a function implementing custom key mappings.
1 parent 77f0045 commit 6b6c4b3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

plugin/vim-todo-lists.vim

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,19 @@ function! VimTodoListsInit()
2828
setlocal shiftwidth=2 expandtab
2929
setlocal cursorline
3030
setlocal noautoindent
31-
call VimTodoListsSetItemMode()
31+
32+
if exists('g:VimTodoListsCustomKeyMapper')
33+
try
34+
call call(g:VimTodoListsCustomKeyMapper, [])
35+
catch
36+
echo 'VimTodoLists: Error in custom key mapper.'
37+
\.' Falling back to default mappings'
38+
call VimTodoListsSetItemMode()
39+
endtry
40+
else
41+
call VimTodoListsSetItemMode()
42+
endif
43+
3244
endfunction
3345

3446

0 commit comments

Comments
 (0)