Emacs Keybindings

AI-generated summary

A user, bitboxer, is experiencing conflicts between Discourse’s editor keybindings and their default Emacs keybindings on a Mac. The editor’s keybindings, such as ^h for headlines and ^b for bold text, are overriding their usual text entry functionality and also disrupting the undo history.

Sam suggested creating a user script to disable the editor’s keybindings, as there is no built-in method to do so. However, sam expressed hesitation in supporting the addition of an optional setting for this feature, considering it an “edge case.”

bitboxer requested the location of the code responsible for the keybindings and eventually found it in MarkdownEditor.Editor.js#1228. Despite finding a potential solution, bitboxer still hopes for a setting within Discourse to override the editor’s keybindings.

I really love using Discourse. It is really awesome to read a discussion on it. Sadly I have a little problem when joining a discussion. The editor overwrites the default emacs keybindings on my mac with own functionality. For example ^h creates a headline, ^b a bold text. I use the emacs keybindings to enter text because I don’t want to move my hand to the cursor keys.

Is it possible to disable those keybindings?

Ah and another problem with those overwrites: they somehow destroy the undo history. When I press them accidentally, I can’t undo it :frowning: .

you would need a user script to disable it. no built in method

Would you consider to add this as an optional setting for the user?

seems too edge casey for me … not sure if I support that

Can you pinpoint the location in the code that does this so that I can write a userscript for this?

somewhere in the composer, don’t know the line off the top of my head.

Found it. It’s in MarkdownEditor.Editor.js#1228.

But it still would be awesome if there was a setting to overwrite this within Discourse.