Keyboard Shortcut overriding (Emmet and Markdown Preview)


#1

I’m trying to figure out how to make ctrl-shift-m always trigger markdown-preview:toggle, but Emmet is conflicting with it and always overpowering it.

I’ve tried to put this in keymap.cson but Emmet’s emmet:merge-lines still prevails as default:

'.workspace, .workspace .editor, .workspace .editor:not(.mini)':
  'ctrl-shift-m': 'markdown-preview:toggle'

How can I force markdown-preview:toggle as a user?


Unbind plugin keybinding
#2

What does the Keybinding Resolver Ctrl+. say when you press Ctrl+Shift+M?

For future reference, the Debugging document covers basic keybinding debugging:

https://atom.io/docs/latest/debugging#check-the-keybindings


#3

Thanks for your help leedohm! I did find the Keybinding Resolver, but it seems my own keymap.cson is not overriding the package default:

… or am I free to edit that emmet.cson without it being clobbered when Emmet updates?


#4

If you’re on the latest version of Atom, you might want to change your selector to simply atom-text-editor and see if that fixes it. (And if you’re not on the latest version of Atom, you should try that too! :grinning:)


#5

Updated to 0.168.0, all packages up to date. Still no dice:


#6

Wait … have you tried just .editor:not(.mini) as your selector? I don’t think the Keybinding Resolver supports the comma operator in selectors.


#7

Yay! That works! Thanks for your help!


#8

Hey,

i have the same problem with emmet and markdown-prewivew. Can you post the string which i have to put into my keymap.cson file to make ‘ctrl-shift-m’ always the ‘markdown-prview:toggle’ -command.

Thanks in advance
Tonka


#9

Had the same issue, fixed it with these lines:

'.editor:not(.mini)':
  'ctrl-shift-M': 'markdown-preview:toggle'

#10

Worked like a charm. Thanks!


#11

I removed the 2 “offending” lines from emmet.cson, as I wasn’t thinking the merge keyboard shortcut was all that important (at present).

Do you think this will cause issues when emmet updates/upgrades? Or maybe my future self will not be happy?

Or maybe there was a better way to manage keybindings. I know that can disable the markdown keybindings and create my own? Curious how the cracker-jack programmers manage keybindings with so many packages…

Thanks for your insight.