jczic / ESP32-MPY-Jama

v1.2 - UI tool for manage Espressif ESP32 microcontrollers with embedded MicroPython for MacOS, Windows and Linux: mini IDE, files manager, REPL, real time dashboards (sys/net), advanced features (gpio/mp3/leds/...)
https://github.com/jczic/ESP32-MPY-Jama
MIT License
424 stars 25 forks source link

Ctrl+/ keyboard shortcut for commenting lines? #19

Open torntrousers opened 1 year ago

torntrousers commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

jczic commented 1 year ago

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 👍🏻