Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Shortcut for code formatting (MarkDown)

#2254

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`)

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

State: new
Milestone: none
Assigned to: benny benny

Activity

  1. benny
    benny
    • 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.

    February 12th, 2019 @ 01:46 PM

  2. Ingo Lantschner
    Ingo Lantschner

    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.

    February 13th, 2019 @ 10:49 AM

  3. benny
    benny

    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.)

    February 13th, 2019 @ 11:40 AM

  4. Ingo Lantschner
    Ingo Lantschner

    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".

    February 14th, 2019 @ 08:31 AM

  5. Ingo Lantschner
    Ingo Lantschner

    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.

    June 10th, 2019 @ 08:43 AM

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.