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

GFM ordered list style not honored when using custom list_item_char 1. #63

Open
bratekarate opened this issue Mar 13, 2020 · 0 comments

Comments

@bratekarate
Copy link

First off

Thanks for this great plugin. I know GFMs way of handling ordered lists is pretty weird, but it still would be nice if this plugin could handle it out of the box.

Issue

I want a numbered TOC. I achieved this by following the advice in this issue on vimwiki, setting g:vmt_list_item_char = '1.'.

This seems to work fine, but GFM is acting very rude, requiring 4 whitespaces of indentation in sublevels. To save some energy, I tried not to be so mad about that.

I inserted the following option in my vimrc as a workaround: g:vmt_list_indent_text = repeat(' ', 4). This is good for now, but I think it would be great to support numbered lists in general.

One issue now is, that if I want to change my item char back to e.g. -, I have to change indent text as well, or live with inconsistent indentation in my document, as my usual shiftwidth is 2 for markdown.

Also, if I use this TOC in other markdown formats, where two whitespaces are permitted, my hardcoded intent text will still be picked up.

Feature request

So my minor suggestions, with low prio, is to offer a global flag to generate numbered TOC. Use 1. as a prefix in this case. This global flag could then be checked for in s:GetIndentText. If it's true AND GFM style is used AND &expandtab is not set, don't use the &shiftwidth, but rather 4 whitespaces. Otherwise use tab or shiftwidth.

@bratekarate bratekarate changed the title GFM ordered list style not honored GFM ordered list style not honored when using custom list_item_char 1. Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant