antonk52 / markdowny.nvim

Markdown like keymaps for toggling text formatting
73 stars 7 forks source link

[asking feature] surround with their own taste #11

Open greyHairChooseLife opened 7 months ago

greyHairChooseLife commented 7 months ago

Hi there!

For the first, thank you for simple and fine plugin. It drives me WRITE something with markdown. :smile:

What I tried

I am trying to make custom function by your plugin that is surrounding with another character like ~ or =.

Because I do note-taking with mkdocs, documenting framework providing extended markdown formatting. That looks just like this: ==highlight==.

So I added up into your plugin like below:

function M.highlight()
    inline_surround('==', '==')
end

vim.keymap.set('v', '<C-h>', ":lua require('markdowny').mark()<cr>", { buffer = 0, silent = true })

Suggestion

I think it would be much better if this plugin provides customable function.

Or maybe just open the local inline_surround function as externally available API.

If you don't mind ...

Maybe I can make PR?

Just in case you are so much endurable for this noob.

antonk52 commented 7 months ago

Hello. Thanks for a detailed write up.

I agree that inline_surround and newline_surround could be exported to build your own functionality. Happy to merge a PR where these two are exported.