Is there a way to disable markdown shortcuts in the text box and enable emacs shortcuts like Crtl-a, Ctrl-k like it works in a terminal?
Iāve added some shortcuts, so I think you should be able to change them as well. As I recall the function to call to add a shortcut was documented fairly well in the source.
sorry Iām not familiar with Ruby, can you point me to the code?
Also, just so we are on same page - we are using a CDCK hosted version and Iām looking for a setting that a user can toggle for themselves.
Iām afraid there isnāt a way to disable markdown, though keyboard shortcuts should be working. Are there any that youāre having issues with?
I donāt want to disable markdown, just the shortcuts, itās annoying when I type Ctrl+K to kill a line and discourse opens a āinsert hyperlink dialogueā
Ah, I see. Sorry for my confusion.
I think a lot of the shortcuts work as youād expect (like select-all, bold, copy, and paste etc), though the hyperlink one does open the modal. I donāt believe there is a way in the settings to disable that, though Iāll check to make sure.
There is a quick āinsert linkā that may be of some use. If you copy a link from somewhere and then highlight the text in your composer youād like to make a hyperlink, you can then paste your link in and it will automatically format it as a markdown hyperlink with the highlighted text as the display text.
Thereās also the inline onebox approach too, which can be quite useful, where just pasting in the link into the composer mid-sentence will add a title where it can. eg Plugin directory | Discourse - Civilized Discussion .
Turns out I did not have a handle on this topic at allā¦
No. They work as you expect, but @manojm321 uses the One True Editor, which has different bindings. Control-K should kill to the end of the line. Control-y should yank text out of the kill buffer and on and on.
@manojm321, itās not ruby you need but javascript and ember. You can do it in a component, I think. Oh, the shortcuts I added were not to the composer but to the main interface. I still think itās possible, but I donāt know that I know where an example is.
You can look for theme components that add to the composer and/or search the source for, maybe, paste.
We do have a plugin API to add keyboard shortcuts:
But we donāt yet have one for removing the shortcut.
The library we are using is a fork of ItsATrap, with documentation here. I expect it should not take too long to add one that removes the shortcut binding itself, and just a bit more work to remove it from shift + ?:
That said, we donāt yet have many requests to do this, so itāll likely not be prioritised until we get more requests. Iām gonna add a pr-welcome as well.
Ah. Thereās the rub. I thought there might be a different api in the composer than in other contexts.
Iāve just adjusted to being multilingual, using emacs, vscode, and vim in various circumstances and with different goals.
Hmmmā¦ I think I pulled a ādidnāt understand the topicā here as well. The request here is specific to the composer.
@pfaffman you are right. Composer specific shortcuts are not handled by ItsATrap, but here instead:
@manojm321, can I suggest to reach out to our @team
if youād like to explore this feature for your community?
I said emacs, but I really mean readline
: readline(3) - Linux manual page
these shortcuts(good chunk, if not all atleast moving the cursor) universally works across lot of text boxes.
sure
This looks like something I would love to have for myself, but I have no idea if the Nanowrimo site where I use Discourse would provide it for one oddball user from the antediluvian past.
As a touch typist since 1984, and an emacs user since the mid 90ās, Iāve got the keyboard motion commands wired in, and there is an effort involved that slows me down when I have to stop my reflexive attempts to do the emacs thing in a Discourse edit box.
But, as I noted, Iām an oddball.