Skip to content

Commit

Permalink
Merge pull request #22 from ronakg/master
Browse files Browse the repository at this point in the history
Allow redefining the default tick symbol from `x` to something else.
  • Loading branch information
vitalk committed Aug 21, 2015
2 parents 5c20cb7 + 2ddba82 commit 5c3fcd0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ imap <c-i> <Plug>(simple-todo-new)

See `:help simple-todo-maps` for list of available <Plug> mappings.

You can also change the tick symbol to something else. Default is `x`.
```vim
let g:simple_todo_tick_symbol = 'y'
```

## Issues

Don't hesitate to open [GitHub Issues](https://github.com/vitalk/vim-simple-todo/issues) for any bug or suggestions.
Expand Down
14 changes: 12 additions & 2 deletions doc/simple-todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Manage todo lists. Really simple. *simple-todo*

1. Intro.................................|simple-todo-into|
2. Mappings..............................|simple-todo-maps|
3. Contributing..........................|simple-todo-contrib|
3. Customization.........................|simple-todo-customization|
4. Contributing..........................|simple-todo-contrib|

==============================================================================
1. Intro *simple-todo-into*
Expand Down Expand Up @@ -59,7 +60,16 @@ let g:simple_todo_map_keys = 0
<leader>X Mark item under cursor as undone

==============================================================================
3. Contributing *simple-todo-contrib*
3. Customization *simple-todo-customization*

The default tick symbol `x` can be changed by defining:

>
let g:simple_todo_tick_symbol = 'y'
<

==============================================================================
4. Contributing *simple-todo-contrib*

Don't hesitate to create a new GitHub Issue for any bug or suggestion:

Expand Down
16 changes: 10 additions & 6 deletions plugin/simple-todo.vim
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ if !exists('g:simple_todo_map_keys')
let g:simple_todo_map_keys = 1
endif

if !exists('g:simple_todo_tick_symbol')
let g:simple_todo_tick_symbol = 'x'
endif

" }}}
" Private functions {{{

Expand Down Expand Up @@ -46,14 +50,14 @@ nnore <Plug>(simple-todo-above) O<c-r>=<SID>get_list_marker(line('.')+1)<cr>[ ]<
inore <Plug>(simple-todo-above) <Esc>O<c-r>=<SID>get_list_marker(line('.')+1)<cr>[ ]<space>

" Mark item under cursor as done
nnore <Plug>(simple-todo-mark-as-done) :s/^\(\s*[-+*]\?\s*\)\[ \]/\1[x]/<cr>
vnore <Plug>(simple-todo-mark-as-done) :s/^\(\s*[-+*]\?\s*\)\[ \]/\1[x]/<cr>
inore <Plug>(simple-todo-mark-as-done) <Esc>:s/^\(\s*[-+*]\?\s*\)\[ \]/\1[x]/<cr>
nnore <Plug>(simple-todo-mark-as-done) :execute 's/^\(\s*[-+*]\?\s*\)\[ \]/\1[' . g:simple_todo_tick_symbol . ']/'<cr>
vnore <Plug>(simple-todo-mark-as-done) :execute 's/^\(\s*[-+*]\?\s*\)\[ \]/\1[' . g:simple_todo_tick_symbol . ']/'<cr>
inore <Plug>(simple-todo-mark-as-done) <Esc>:execute 's/^\(\s*[-+*]\?\s*\)\[ \]/\1[' . g:simple_todo_tick_symbol . ']/'<cr>

" Mark as undone
nnore <Plug>(simple-todo-mark-as-undone) :s/^\(\s*[-+*]\?\s*\)\[x\]/\1[ ]/<cr>
vnore <Plug>(simple-todo-mark-as-undone) :s/^\(\s*[-+*]\?\s*\)\[x\]/\1[ ]/<cr>
inore <Plug>(simple-todo-mark-as-undone) <Esc>:s/^\(\s*[-+*]\?\s*\)\[x\]/\1[ ]/<cr>
nnore <Plug>(simple-todo-mark-as-undone) :execute 's/^\(\s*[-+*]\?\s*\)\[' . g:simple_todo_tick_symbol . ']/\1[ ]/'<cr>
vnore <Plug>(simple-todo-mark-as-undone) :execute 's/^\(\s*[-+*]\?\s*\)\[' . g:simple_todo_tick_symbol . ']/\1[ ]/'<cr>
inore <Plug>(simple-todo-mark-as-undone) <Esc>:execute 's/^\(\s*[-+*]\?\s*\)\[' . g:simple_todo_tick_symbol . ']/\1[ ]/'<cr>

" }}}
" Key bindings {{{
Expand Down

0 comments on commit 5c3fcd0

Please sign in to comment.