I am trying to map MarkdownPreviewToggle to an key like "mk". My vimrc is like it:

nnoremap mk <Plug>MarkdownPreviewToggle

But it doesnt work, what should i do? (the other key isnt work too.)

1 Answer 1


Use nmap instead of nnoremap for <Plug> mappings:

nmap mk <Plug>MarkdownPreviewToggle

The <Plug> mappings are defined by plug-ins, so you need to be able to expand other mappings in your expansion in this case.

  • 1
    Thank you for your solution! It actually works.
    – BreezyMain
    May 2, 2021 at 0:00
  • 1
    @BreezyMain you can indicate usefulness with an upvote, and that it solved your problem by accepting the answer.
    – D. Ben Knoble
    May 2, 2021 at 1:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.