elementary / code

Code editor designed for elementary OS
https://elementary.io
GNU General Public License v3.0
481 stars 114 forks source link

Commenting keyboard shortcuts #348

Closed nevack closed 6 years ago

nevack commented 6 years ago

Why not Ctrl+/ for single line and Ctrl+Shift+/ for multiline commenting instead Ctrl+M for everything? It's default shortcuts in many IDEs.

michaelkanis commented 6 years ago

Ctrl+/ only works on English keyboard layouts. The "/" needs to be typed with the shift key on these layouts and probably many others: German, French, Spanish, Italian, ...

arshubham commented 6 years ago

@michaelkanis Even vsocde uses ctrl+/ for English Keyboard. Don't know about the others. Maybe code can change the shortcut based on keyboard, or better make it configurable. The only IDE I used which uses Ctrl+M by default is gnome Builder and After using it for a months still doesn't feel natural.

cassidyjames commented 6 years ago

Ctrl / currently selects all text, which I'm guessing is a built-in from GtkSourceView and the reason we didn't override it. I am used that shortcut for commenting in Atom, though, so I'd be okay with saying Ctrl A is the Select All shortcut, and Ctrl / is for commenting so long as it's technically feasible and doesn't break expectations.

We do also need to figure out what happens in other keyboard layouts. Whatever we pick will end up becoming second nature if you're using Code as your primary editor, though. :wink:

danirabbit commented 6 years ago

We're allowed to have multiple accelerators as well so we could have both Ctrl / and Ctrl M

cassidyjames commented 6 years ago

I'm happy with that solution!