Open andytlr opened 10 years ago
Yeah, this would need to be handled explicitly in some code that binds to inserting text in the editor the same way that bracket-matcher completes the closing bracket as you type.
I'd also like this. I tend to have a markdown outline open all the time to collect notes for any given project.
+1
I'm curious if it makes sense for a feature like this to live in the language-gfm package or in a separate package? I went ahead and started working on a separate package (https://atom.io/packages/gfm-lists) that has basic list support for GitHub Markdown.
It could definitely use some refinement though :)
This looks cool to me.
It doesn't appear to clear the last empty item it you hit return a second time. I can make an issue if you like.
One thing that may be worth discussing is whether the enumerated list should fill sequential numbers or just 1.
for every item. When I'm using markdown, I use 1.
for every enumerated item because I frequently reorder, delete, and insert items. It's a design feature of markdown that I like, but I'm not sure how many people use it like I do.
It doesn't appear to clear the last empty item it you hit return a second time. I can make an issue if you like.
:+1: Pull requests are welcome too :grin:
One thing that may be worth discussing is whether the enumerated list should fill sequential numbers or just 1. for every item. When I'm using markdown, I use 1. for every enumerated item because I frequently reorder, delete, and insert items. It's a design feature of markdown that I like, but I'm not sure how many people use it like I do.
Definitely create an issue for this and let's chat through it. I really like that feature of markdown as well and honestly it would make the code much simpler.
Hello all, I've just pushed an update of my language-markdown package that implements automatically inserting new list-items (except after empty ones) for all types of list-items in Markdown. I'm also thinking of overriding the behavior of tab and shift + tab to manipulate list-item indentation. I'd appreciate if you could take a look. Any feedback is welcome.
/cc @andytlr @kevinsawicki @jtkiley @jonmagic @lee-dohm @maxheld83
In the most simple form this would insert an empty list item when you hit return.
Would insert a new item:
Hitting return again would clear that item.
Doing so mid list would also insert a new item, I.e.:
This should work with
-
,+
and- [ ]
as well as*
. It probably gets more tricky with ordered lists because you'd want to increment the number.That's probably hard but not as hard as inserting a new list item mid-list and re-numbering all of the items so you don't end up with:
I use a package in Sublime that does something similar, but it isn't great. Byword probably has the best implementation which I've put in gif form:
I've tried to hack something in with snippets with no success. I thought a solution might be some kind of context aware keymap. But I'm lost as to where to start.