MeanderingProgrammer / markdown.nvim

Plugin to improve viewing Markdown files in Neovim
MIT License
503 stars 20 forks source link

Allow users to configure default enabled state #16

Closed cleong14 closed 2 months ago

cleong14 commented 2 months ago

Allow users to configure the default enabled state when opening and viewing a markdown file.

https://github.com/MeanderingProgrammer/markdown.nvim/blob/467c13523153f9b918c86037d0b5f2a37094cb88/lua/render-markdown/init.lua#L132

MeanderingProgrammer commented 2 months ago

What's the intended usage here?

So by default you load all markdown as raw and then you can toggle rendering on. That doesn't seem likely IMO but am curious what you had in mind.

cleong14 commented 2 months ago

This is largely based on my own personal preferences, but I think providing users the choice on whether to render markdown files by default or not comes with more benefits (e.g. being able to disable default rendering on the fly) compared to not being able to configure the default render state (e.g. to disable default rendering we would need to disable the plugin entirely).

For example, markdown-preview.nvim allows users to configure whether or not a preview of the rendered markdown will automatically open in a new browser window. I know markdown-preview.nvim has its own set of use cases and I only mention it as an example of the intended use case I had in mind when I created the issue and PR.

Also, FWIW I tried to keep the enabled state of the plugin set to true by default and the user has the option to disable it in their config. However, I could not seem to get the plugin to disable rendering by default and the only way I was able to achieve that was with the changes I made in this PR.

That being said, I certainly agree that my changes should not affect the current default state that you have in place, ideally my changes should primarily be focused on adding an option for the user to disable default rendering in their own config, and I would not only be open to that as the solution but I would have preferred it over the changes in this PR. I just hadn't figured out how to implement the solution in that way at the time is all.

MeanderingProgrammer commented 2 months ago

Gotcha. Sounds like something that might be a preference for some users. Since it's a simple change no harm in adding it.

MeanderingProgrammer commented 2 months ago

Thanks for the proposal and the PR!