Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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 <silent> <your_key_map_here> :call checkbox#ToggleCB()<CR>
10 changes: 9 additions & 1 deletion plugin/checkbox.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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 <silent> <your_key_map_here> :call checkbox#ToggleCB()<CR>
" ****************************************************************************

if exists('g:loaded_checkbox')
Expand Down Expand Up @@ -82,6 +87,9 @@ endf

command! ToggleCB call checkbox#ToggleCB()

map <silent> <leader>tt :call checkbox#ToggleCB()<cr>
" Create keymaps only if configured to do so (defaults to 'yes')
if get(g:, 'checkbox_create_maps', 1)
map <silent> <leader>tt :call checkbox#ToggleCB()<cr>
endif

let g:loaded_checkbox = 1