#2254 new
Ingo Lantschner

Shortcut for code formatting (MarkDown)

Reported by Ingo Lantschner | February 8th, 2019 @ 11:33 AM

I have several shortcuts (key-bindings) out of the box. E.g. cmd+B for bold, cmd+I for italic and cmd+K for creating an URL.

How could I change or add such shortcuts? E.g.

  • Change creating an URL from cmd+K to cmd+U

  • Add cmd+K to code-format (change my code snippet to `my code snippet`)

Comments and changes to this ticket

  • benny

    benny February 12th, 2019 @ 01:46 PM

    • State changed from “new” to “accepted”

    You can change default shortcuts somewhere in the System Preferences ▸ Keyboard pane.

    The ⌘K is based on TextEdit (and probably others). I assume you have ⌘K from some other application?

    I guess MailMate should also have a default shortcut for code snippets. Maybe even automatically detecting if multiple lines are selected. I'll put this in the accepted state for that, but I have already added that something like this should work in the next update:

    "@C" = "toggleCode:";
    

    It works like bold/italic. In this example, I've given it the ⇧⌘C shortcut.

  • Ingo Lantschner

    Ingo Lantschner February 13th, 2019 @ 10:49 AM

    Thanks benny! I can't find the cmd-K anywhere in the Systempreferences. In TextMate it's used for code-formating and what exactly it does depends on the context. I am quite sure that I would find that inside of the TextMate Bundles - so this unrelated to your product I guess.

    In MailMate I get an URL with that same key-combination (cmd-K) which is always a bit confusing for me. Therefore my intention to change that to something else. If understood you correctly a keybinding for code-formating will be possible in some future update.

    The only question left for the moment: Where can I change the URL-formating (from cmd-K to whatever)? It's not in the System-wide preferences and at least in the GUI of MailMate I did not find it as well.

  • benny

    benny February 13th, 2019 @ 11:40 AM

    Go to System Preferences ▸ Keyboard ▸ Shortcuts ▸ App Shortcuts and add a new item to override the key for the existing one (“Add Link”). (I haven't verified that this works.)

  • Ingo Lantschner

    Ingo Lantschner February 14th, 2019 @ 08:31 AM

    Thanks and yes it works exactly as you described. I have chosen ⌘U and now it makes an URL in MailMate and ⌘K is free for the upcoming "Format Code".

  • Ingo Lantschner

    Ingo Lantschner June 10th, 2019 @ 08:43 AM

    Thanks Benny, hiting ⌘K to format a code-snippet works now in the new release. It took me a while to find the place where to set this key-binding. It's not in the Systempreferences as the above mentioned example for adding a link but in a special plist-file in ~/Library/Application Support/MailMate/Resources/KeyBindings/ (others may have to create and mention the file first in the MailMate preferences). The help of Mailmate regarding Custom Keybindings helped me to find that.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Mac OS X email client.

Shared Ticket Bins

People watching this ticket

Pages