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 shortcuts for markdown editor #1826
Comments
Thanks for the request! We have some shortcuts implemented for comments but I can't see a reason why we wouldn't also have it for posts |
For implementation, there is a GitHub lib we may want to make use of. I think it's this one, unless I'm confused: https://github.com/github/hotkey We could do this on top of the current implementation, but we could migrate towards this library. It makes sense to get inline with GH as an app with similar use cases. Let me know if I'm mistaken about that being the right library. |
There is also https://github.com/jaywcjlove/hotkeys which is widely used and has a better API. You must consider it as well. |
I would say using a long-run maintained library instead of 1 month old one should be considered as a "more win" for production. Even if the latter is developed by GitHub. Plus, there is a React component ready to go. |
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue in 7 days. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If this issue still requires attention, please respond with a comment. Happy Coding! |
Is your feature request related to a problem? Please describe.
Having keyboard shortcuts always comes in handy. Next to every single markdown editor (including the one I'm using to write this issue) offers at least a couple of very basic shortcuts for bold/italic/code blocks, etc. Being able to keyboard-ninja comments and posts can greatly benefit user experience.
Describe the solution you'd like
Pressing Ctrl+[key] will format the currently selected text with appropriate tags:
B: **bold text**
I: _italic_
L: [link]()
with a cursor moving to the position where you're one ctrl+v away from creating a valid link1-6: # level 1-6 headers
(similar to, let's say, editor.md{% user name %}
or{% github thepracticaldev/dev.to %}
The above is subject to discuss of course, there are many different implementations of markdown shortcuts that differ from one library to another.
Describe alternatives you've considered
Coming back to my previously written text and manually arrowing my cursor is the only alternative (not including browser extentions, but a very quick Google search didn't bring up anything worthy).
Additional context
I'm up for taking care about this if it gets approved.
The text was updated successfully, but these errors were encountered: