MacDownApp / macdown

Open source Markdown editor for macOS.
https://macdown.uranusjr.com/
9.45k stars 1.09k forks source link

Add hooks for customised hotkey combinations #405

Open uranusjr opened 9 years ago

uranusjr commented 9 years ago

Inspired by #404. Not sure if it is possible though.

Maybe it would be even better to move existing hotkeys into this infrastructure, if it happens. There were talks about changing cmd-K and cmd-shit-K before, too. Different people want different hotkeys, and it is impossible to satisfy all with one configuration.

Jmuccigr commented 9 years ago

Can't one just use the built-in keyboard pref pane for this?

For example, I just changed Close to cmd-L and it worked. As long as there's a menu command to hook up to, keyboard equivalents are already customizable.

uranusjr commented 9 years ago

For existing shortcuts, System Preferences works well enough, yes. This one is for editor behaviours that do not exist. For example, if somebody uses the TOC token ([toc]) a lot, it can be assigned to a custom key binding (cmd + t, for example).

NickVolynkin commented 9 years ago

Just managed to assign a hotkey via System Preferences.

That's how it is done, in case somebody needs an illustration:

screen shot 2015-07-05 at 12 59 11
Jmuccigr commented 9 years ago

For things that don't exist in the menus already, I would recommend a keyboard-shortcut app.

I'd much prefer the developers to spend their energy on core functions and bugs, not on things that can be done with other tools.

uranusjr commented 9 years ago

I was certainly not aware of utilities that can add shortcuts that don’t exist. Could you provide some examples on how to, say, mimic the cmd-B (toggles the **thing** markup) shortcut? I would definitely be happy to delegate these things to a general utility than implement it my self.

Jmuccigr commented 9 years ago

As long as there's a menu command, use the system preferences to add a keyboard command, but there has to be a menu command with or without a keyboard equivalent.

I was thinking that adding the functionality to be able to re-assign those commands within the app isn't worth it at this point, given other things on the request list.

uranusjr commented 9 years ago

So, put it another way, custom keyboard mapping is not possible for something that does not exist in the menu. Am I correct? If that’s the case, this enhancement is not completely useless. It wouldn’t be on the top of my list, but still something worth having.

Jmuccigr commented 9 years ago

Yes, that's right.

I agree that it would be nice. Personally I like the floating palette approach that BBEdit uses.

But the advantage of MacDown for me is the instant rendering. I would think that adding new menu items wouldn't be very difficult since you've already got a bunch of them in.