vim-markdown icon indicating copy to clipboard operation
vim-markdown copied to clipboard

Recognize `[ ]` as part of a bullet

Open daturkel opened this issue 5 years ago • 8 comments

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 - .

daturkel avatar Jun 10 '19 18:06 daturkel

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 - [ ]?

benlk avatar Mar 06 '20 20:03 benlk

I should note I implemented this in a local fork here: https://github.com/daturkel/vim-markdown/commit/9adae9867d68c53756d327d39243aacf52441beb

daturkel avatar Jul 05 '20 18:07 daturkel

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

joshuachp avatar Nov 08 '20 11:11 joshuachp

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?

daturkel avatar Nov 16 '20 20:11 daturkel

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.

joshuachp avatar Nov 17 '20 09:11 joshuachp

Added pull request #529

joshuachp avatar Nov 17 '20 09:11 joshuachp

The question now is if the project is still active 😞

joshuachp avatar Nov 17 '20 09:11 joshuachp

Unfortunately it may not be :/

daturkel avatar Dec 22 '20 22:12 daturkel