-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard shortcut for indenting lines of code in the code block #15791
Comments
Hey @wclear Will. Is this issue still relevant? Should it be closed? |
Hey @paaljoachim. I believe this issue is still relevant. I don't know if I've overlooked a development in the editor for the code block recently, but all the methods for indenting in the code block editor proposed in the issue continue to not work (and I can't find a method that does work). It seems like it is still not possible to indent and outdent lines of code with tab characters in the code block using only the keyboard. |
Thanks @wclear Will I will ping some developers (making my best guess) who might have some ideas about this. |
Wonderful, thank you @paaljoachim! |
Matching what we do for the List block and using Cmd + ] and Cmd + ] makes sense to me. |
Hi team, if this issue is still relevant I can take it up. |
I believe it is still relevant. Please do take it up @amustaque97 |
@paaljoachim, looks like currently there is no option for indentation and outdentation. Do we need to implement indent and outdent feature first(and part of this issue) then work on the shortcut keys? If yes, what is the requirement for indent/outdent? Please share your ideas! Thanks |
Hi @amustaque97 Perhaps @getdave might have som ideas....:) |
I suggest bringing this one up in the Core Editor chat. It seems like a good idea but I can't personally commit to it at this time. |
This was discussed during the Core Editor chat. The consensus was that it would be great if someone could raise a PR using one of the keyboard shortcuts suggested above. We can then all test and refine the shortcuts as required. Is anyone open to taking this one on? |
Forwarding important feedback left in #core-editor on Slack (registration required):
|
As I am currently redoing my WordPress tutorial site I am adding a lot of code into Code blocks. It would be helpful if someone is able to add Tab as a key to indent in the Code block, or in a block that uses text. @mcsf Miguel is this perhaps something you might be able to pick up? |
Not anytime soon, unfortunately. |
Alrighty. Thanks for the response Miguel. We will see when this issue moves onward. |
Is your feature request related to a problem? Please describe.
In the code block editor I would like to be able to indent and outdent lines of code with a minimal number of keystrokes.
Describe the solution you'd like
Ideally:
The key combination could be:
Ctrl
+]
(indent) andCtrl
+[
(outdent)Alt
+0
+0
+9
inserts a tab in the code block editor on all major browsers could make up part of the solution as this already inserts a tab character in Chrome and Edge but not in Firefox. This does not allow indenting and outdenting multiple lines of selected code at once however.Ctrl
+Option
+Tab
inserts a tab character in the code block editor on all major browsers could make up part of the solution as this already inserts a tab character in Safari but not Chrome or Firefox.Describe alternatives you've considered
The text was updated successfully, but these errors were encountered: