A super simple plugin that generates checkboxes that can be checked, unchecked, and in progress. Simple to use, full of features.
With pathogen, inside your ~/.vim/bundle
git clone https://github.com/bmustiata/vim-todo/
Recommended usage is to bind space
to TodoToggle
, into your .vimrc
.
map <Space> :TodoToggle<cr>
- [ ] Task 1
- [x] Task 2
- [x] Task 3
Has the output:
- Task 1
- Task 2
- Task 3
Output in vim:
[ ] Line 1
[x] Task 1
[x] Task 2
[ ] Task 3
You can use custom check marks, and disable the square brackets generation.
Thus you can use characters such as:
https://en.wikipedia.org/wiki/Check_mark
https://en.wikipedia.org/wiki/X_mark
Vim settings:
let g:TodoItemChecked = '☒'
let g:TodoItemUnChecked = '☐'
let g:TodoShowSquareBrackets = 0
Output in Vim:
☐ Line 1
☒ Task 1
☒ Task 2
☐ Task 3
Vim settings:
let g:TodoItemChecked = 'yes'
let g:TodoItemUnChecked = 'no '
Output in Vim:
[no ] Line 1
[yes] Task 1
[yes] Task 2
[no ] Task 3
Vim settings:
let g:TodoItemChecked = 'PASSED'
let g:TodoItemUnChecked = 'FAILED'
let g:TodoShowSquareBrackets = 0
Output in Vim:
FAILED Line 1
PASSED Task 1
PASSED Task 2
FAILED Task 3
vim-todo
is aware of unordered or ordered lists, and keeps the indentation inside the list.
For example toggling the todo checkbox on each line for:
Overall
9. List:
i. First item
ii. Second item
iii. Third item
10. List:
i. First item
ii. Second item
iii. Third item
will result in:
[ ] Overall
9. [ ] List:
i. [ ] First item
ii. [ ] Second item
iii. [ ] Third item
10. [ ] List:
i. [ ] First item
ii. [ ] Second item
iii. [ ] Third item
This plugin exports the following commands to your Vim:
TodoToggle
Toggles the current checkbox. Creates it if needed.
TodoCreateBox
Creates a checkbox for the current text.
TodoRemoveBox
Removes a checkbox for the current text.
Initial text:
1. Go to the sea
2. Watch the sea
3. Go back
TodoToggle
on the first line:
1. [ ] Go to the sea
2. Watch the sea
3. Go back
TodoToggle
again:
1. [x] Go to the sea
2. Watch the sea
3. Go back
And TodoToggle
again:
1. [-] Go to the sea
2. Watch the sea
3. Go back
And TodoToggle
again:
1. [ ] Go to the sea
2. Watch the sea
3. Go back
And TodoToggle
again:
1. [x] Go to the sea
2. Watch the sea
3. Go back
Etc.
The plugin allows configuration with the following variables:
-
g:TodoItemChecked
A string that specifies what characters to be used for the check value. If the
g:TodoShowSquareBrackets
is1
then the expression must not contain]
, otherwise it must not contain theg:TodoItemUnChecked
org:TodoItemInProgress
. -
g:TodoItemUnChecked
A string that specifies what characters to be used for the unchecked value. If the
g:TodoShowSquareBrackets
is1
then the expression must not contain]
, otherwise it must not containg:TodoItemChecked
org:TodoItemInProgress
. -
g:TodoItemInProgress
A string that specifies what characters to be used for an item that is still in progress. If the
g:TodoShowSquareBrackets
is1
then the expression must not contain]
, otherwise it must not containg:TodoItemUnChecked
osg:TodoItemChecked
. -
g:TodoShowSquareBrackets
0
or1
, if to show the square brackets around the items checked or unchecked.