hotkeysplus-obsidian icon indicating copy to clipboard operation
hotkeysplus-obsidian copied to clipboard

Switch to numbered list with right numbers in markdown

Open Faxix opened this issue 3 years ago • 5 comments

Thank you for nice plugin. I love changing style of lists. After switching to numbered/ordered list in markdown every line start with "1." For me it is huge eye-sore. Is it possible to have list with right numbers in markdown? (May be only after selecting and switching whole list? Changing whole list numbers after switching one line may be too much for other use-cases...) Thank you and have a nice day

Faxix avatar Feb 07 '21 14:02 Faxix

I'll quote my reply from #6:

Regarding the first issue, I'm afraid I can't invest more time making the ordered lists smarter, that would require knowing if the line above also contains a list element, and also consider the indentation of all selected elements (which I'll be honest, is not smart either). Feel free to open a PR for it though!

While I can't invest time in a "smart" ordered list change, I will happily accept PRs if anyone wants to tackle this!

argenos avatar Feb 08 '21 11:02 argenos

the all 1. is relly annyonying. really time consuming to change all the numbers to the "correct" numbers. wish there was way to do it one click. How is this even a issue in the first place :D

jayomu avatar Oct 12 '21 12:10 jayomu

@jayomu I'll happily accept a PR if you want to work on the fix! The 1. comes from the markdown spec (see this for more info.)

argenos avatar Oct 12 '21 12:10 argenos

I happened across this and wanted to add a quick note about using all 1.s for ordered lists. If you create an ordered list but need to add an item anywhere other than the bottom of the list that would require you to renumber at least some part of the list. If this edited list is also part of a git repository it would cause the rest of the list to be reported as changed even though the items themselves have not changed. Since rendering the markdown produces the correct numbering I personally see using all 1.s as a benefit.

samuel-odinware avatar Nov 10 '21 21:11 samuel-odinware

I am sorry for asking here, but what did you do to enable 1-based numbering? I reorder items often (and copy lines down with Hotkey++, which is my main use case for this plugin) and actually want lists only to use 1-based indexes, but Obsidian is numbering them for me sequentially. I have Hotkey++ with pretty much default settings, Obsidian v0.14.6. Thanks!

berezovskyi avatar May 12 '22 11:05 berezovskyi