diff --git a/README.markdown b/README.markdown index e74291a..dcb95fd 100644 --- a/README.markdown +++ b/README.markdown @@ -45,3 +45,8 @@ useful for adding a space behind or in front of the checkbox: Inserting a checkbox can be disabled by setting `g:insert_checkbox` to an empty string (`''`). + +The default keymap can be customized by setting the following: + + let g:checkbox_create_maps = 0 + map :call checkbox#ToggleCB() diff --git a/plugin/checkbox.vim b/plugin/checkbox.vim index dda557c..4f23ba1 100644 --- a/plugin/checkbox.vim +++ b/plugin/checkbox.vim @@ -32,6 +32,11 @@ " " Inserting a checkbox can be disabled by setting g:insert_checkbox to an " empty string (''). +" +" The default keymap can be customized by setting the following: +" +" let g:checkbox_create_maps = 0 +" map :call checkbox#ToggleCB() " **************************************************************************** if exists('g:loaded_checkbox') @@ -82,6 +87,9 @@ endf command! ToggleCB call checkbox#ToggleCB() -map tt :call checkbox#ToggleCB() +" Create keymaps only if configured to do so (defaults to 'yes') +if get(g:, 'checkbox_create_maps', 1) + map tt :call checkbox#ToggleCB() +endif let g:loaded_checkbox = 1