ixru / nvim-markdown

Markdown Vim Mode
http://plasticboy.com/markdown-vim-mode/
81 stars 11 forks source link

Disabling insert mode mappings #13

Open pcewing opened 7 months ago

pcewing commented 7 months ago

First off, thanks for making this plugin, I've been enjoying using it so far!

I use UltiSnips as a snippet engine and I have <tab> as my insert mode mapping for expanding snippets which conflicts with the default Markdown_Jump mapping in nvim-markdown. The README.md here states:

To disable a map use:
map <Plug> <Plug>Markdown_MoveToParentHeader`

For the insert mode mappings, this actually doesn't work because map only sets mapping for mapmode-nvo. So, to resolve the conflict and disable the Markdown_Jump mapping, I had to do:

imap <Plug> <Plug>Markdown_Jump

Not a big deal but it took me a few minutes to figure out and I imagine this conflict won't be that uncommon since <tab> is a common mapping for snippet and completion plugins. I can try to put up a PR to add a note about this in the README.md but I'm at work at the moment so can't get to that until later.

ixru commented 7 months ago

Yes sorry about that. Maybe just '(i)map \<Plug> ...' in readme. I'll see to doing it

pcewing commented 6 months ago

After using this for some time, I do wish I could have both functionalities as disabling the insert-mode tab mappings makes working with markdown lists less ergonomic. I'm not sure if this is possible but it would be great if when I pressed tab in insert mode, if there is a snippet to expand that would take priority but if not, the Markdown_Jump function would execute as normal.

Given that this plugin will not know (And shouldn't care) what other plugins it might conflict with that's probably something I need to configure on my own. If I ever get around to figuring it out, will try to contribute it back to the docs.

ixru commented 6 months ago

I made certain stuff very specific to overcome small personal inconveniences vim couldn't tackle, so it's kinda bespoke to me. If you really want to use it I'd suggest just forking and removing the parts of the function you don't want. I don't think there's any workaround for disabling part of it through configuration if that is what you mean, but pr's are always welcome.