Skip to content
Closed
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
16 changes: 16 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,19 @@ 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 (`''`).

Mapping
-------

By default a global mapping is `<leader>tt` used. This can cause problems if
you already use that mapping and this plugin is lazy-loaded.
In this case you can to suppress this mapping by setting:

let g:checkbox_suppress_mapping = 1

And the map the command however you want. For example, a buffer local mapping
for Markdown files only by adding the following to `.vim/ftplugin/markdown.vim:`

```vim
map <buffer><silent><leader>tt :call checkbox#ToggleCB()<cr>
```
4 changes: 3 additions & 1 deletion plugin/checkbox.vim
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ endf

command! ToggleCB call checkbox#ToggleCB()

map <silent> <leader>tt :call checkbox#ToggleCB()<cr>
if !exists('g:checkbox_suppress_mapping') || g:checkbox_suppress_mapping != 1
map <silent> <leader>tt :call checkbox#ToggleCB()<cr>
endif

let g:loaded_checkbox = 1