Skip to content
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

Ctrl+/ keyboard shortcut for commenting lines? #19

Open
torntrousers opened this issue Feb 11, 2023 · 5 comments
Open

Ctrl+/ keyboard shortcut for commenting lines? #19

torntrousers opened this issue Feb 11, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@torntrousers
Copy link

From other IDEs I'm used to being able to comment / uncomment lines with the keyboard shortcut pessing the ctrl key and the / key. So with the cursor anywhere on a line or with multiple lines highlighted the ctrl+/ will insert a comment character at the start of the line or if the lines are already comments then it will remove the comment character.

Any chance you could add this to the code editor?

@jczic jczic added the enhancement New feature or request label Feb 11, 2023
@jczic
Copy link
Owner

jczic commented Feb 11, 2023

Hi @torntrousers and thanks for your message.
It's a good idea 👍🏻 but honestly I don't know when I can work on it :o

@torntrousers
Copy link
Author

Hunting about I found this, which does what I'd like: https://github.com/replit/codemirror-vscode-keymap
How hard would it be to put that into this?

@jczic
Copy link
Owner

jczic commented Feb 11, 2023

Yes, this is indeed the place to put the key combinations.
However, after that, it still have to modify the editor code accordingly of course :)

@torntrousers
Copy link
Author

or this makes it look easier: https://pham.codes/blog/toggling-comments-for-custom-codemirror-modes

@jczic
Copy link
Owner

jczic commented Feb 13, 2023

Thank you @torntrousers, I saw the addon in the official codemirror addons page too:
https://codemirror.net/5/doc/manual.html#addons -> search "comment.js" on this page.
Just give me some time to add it 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants