vim-markdown
vim-markdown copied to clipboard
Recognize `[ ]` as part of a bullet
Thanks to github markdown, it's pretty common to make todo lists like so:
- [ ] unfinished task
- [x] finished task
It would be nice if hitting enter after a line like this would create a new bullet with the prefix - [ ]
rather than just -
.
This is where it would be added, probably:
https://github.com/plasticboy/vim-markdown/blob/da5a7ac96f517e0fd6f886bc3fbe27156ca1f946/indent/markdown.vim#L11-L15
Do we know what the proper syntax is for marking - [ ]
as a bullet, and marking that - [x]
should be followed by - [ ]
?
I should note I implemented this in a local fork here: https://github.com/daturkel/vim-markdown/commit/9adae9867d68c53756d327d39243aacf52441beb
Is there a pull request for this feature?
Also we could add b:1.
, to support numbered list since lists of only 1.
are automatically numbered. #298
I personally those are easier to sort then a list of different numbers (1., 2., ...).
We could also add a test case in indent-new-list-item.vader
Given markdown;
- [ ] item1
Do (new line from the first item of the list and add the second item):
A\<Enter>item2
Expect (insert another list item with the check-box automatically):
- [ ] item1
- [ ] item2
I did not make a PR but can if desired. There's the tricky case pointed out by @benlk that - [x]
should likely be followed by - [ ]
but I'm not sure if that's possible here?
I made the - [x]
work with the following three part comment
set comments^=s:-\ [x],mb:-\ [\ ],eb:-\ [\ ]
I quickly test it and it seems to work fine. I'll add all together and try it works.
Added pull request #529
The question now is if the project is still active 😞
Unfortunately it may not be :/