Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to toggle lines into numbered list? #184

Open
jackywu opened this issue Mar 14, 2023 · 5 comments
Open

How to toggle lines into numbered list? #184

jackywu opened this issue Mar 14, 2023 · 5 comments
Assignees
Labels
question Ask a question.

Comments

@jackywu
Copy link

jackywu commented Mar 14, 2023

Sorry to bother you, I have searched through the documents on GitHub and the help in Vim, but I couldn't find how to convert multiple lines into a numbered list. Could you please tell me how to do it?

PS. Thank you for your plugin, it really helped me a lot.

@SidOfc
Copy link
Owner

SidOfc commented Mar 15, 2023

No problem, it seems that I did not build functionality like that actually. There are only toggle functions to convert to unordered list items / checklist items. It's been a while since I built those functions but I believe that I did not build a numbered list toggle due to the difference in complexity.

All the unordered list / checkbox markers require is a regular expression replace, whereas parsing a (maybe nested) list into a numbered list takes quite a bit more effort to do right.

Second part is that while building, I probably opted out of parsing into numbered lists since I myself use mostly unordered lists and thought I could wait until someone would request the feature.

Quite some time has passed though and I've since put mkdx on feature freeze due to the codebase being quite messy and complex so even while this feels like a natural addition I'm not sure how I feel about making an exception to this rule.

Cheers for trying mkdx though, glad you've liked it so far :)

@SidOfc SidOfc self-assigned this Mar 15, 2023
@SidOfc SidOfc added the question Ask a question. label Mar 15, 2023
@jackywu
Copy link
Author

jackywu commented Mar 15, 2023

if you continue to improve this plugin in the future, that would be a greate news, as it is truly the best among all markdown plugins and it should only get better in the future.

@SidOfc
Copy link
Owner

SidOfc commented Mar 15, 2023

I will leave this option open while I'm thinking about making an exception. In general I think mkdx would need a complete rewrite with some fresh tests. Mkdx was my first ever vim plugin in addition to struggling with understanding how the editor worked back then I also didn't write the best code so there are a fair amount of unsolved edge cases as well.

I've also switched to Neovim myself and while writing my own file explorer plugin in Lua using Neovim's Lua API I realized I much prefer writing Lua to VimScript so I was thinking that instead of rewriting mkdx in VimScript, I am better off building a better tested, simpler and much faster markdown plugin in Lua at the cost of being Neovim only.

@jackywu
Copy link
Author

jackywu commented Mar 15, 2023

I will leave this option open while I'm thinking about making an exception. In general I think mkdx would need a complete rewrite with some fresh tests. Mkdx was my first ever vim plugin in addition to struggling with understanding how the editor worked back then I also didn't write the best code so there are a fair amount of unsolved edge cases as well.

I've also switched to Neovim myself and while writing my own file explorer plugin in Lua using Neovim's Lua API I realized I much prefer writing Lua to VimScript so I was thinking that instead of rewriting mkdx in VimScript, I am better off building a better tested, simpler and much faster markdown plugin in Lua at the cost of being Neovim only.

New vim also support lua plugin, looking forward your work

@SidOfc
Copy link
Owner

SidOfc commented Mar 15, 2023

It seems so indeed but I am afraid that Vim's Lua API is not quite as extensive as Neovim's Lua API which provides a lot of extras which make writing plugins easy. Additionally I am not a fan of supporting two different Lua APIs as that will only cause pain from maintenance perspective (mkdx tries this in VimScript with some async features which "works" but is far from ideal).

Once both their Lua APIs are similar enough I could look into rewriting mkdx for both, but until then I am going to stick to Neovim's Lua API and therefor a Neovim only Lua plugin when I decide to rewrite mkdx.

Cheers for the heads up though, I hope both APIs will end up being the same in the end so that "Neovim only" plugins can become a thing of the past :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Ask a question.
Projects
None yet
Development

No branches or pull requests

2 participants