Vscode-gitlens: Avoid `⎇ + any` shortcuts because of conflicts with different keyboard layouts

Created on 27 Jun 2017  Â·  14Comments  Â·  Source: eamodio/vscode-gitlens

The keybind bellow are very useful for languages that use a lot a accents, like portuguese.
IMO it should be avoided.

⎇ + c = ç
⎇ + e = ´ (accent)
⎇ + = (accent)
⎇ + n = ˜ (accent)
⎇ + i = ˆ (accent)
⎇ + u = ¨ (accent)

It's just a suggestion. I know that's possible remove this keybind and I'm already did it.

bug

Most helpful comment

In general, ⎇ is not a modifier key for commands on macOS, it should only be used for special characters.

All 14 comments

In general, ⎇ is not a modifier key for commands on macOS, it should only be used for special characters.

Also on Scandinavian macs (at least Norwegian) SHIFT+⎇+7 is used for \ (Backslash)

With gitlens active I can no longer type backslashes in VSCODE because it triggers search, ref: SHIFT+⎇+7

Is it possible to reassign this?

@larsboldt you can specifically remove a shortcut key -- see https://code.visualstudio.com/docs/getstarted/keybindings#_removing-a-specific-key-binding-rule

I think you just need to add the following to remove that key-binding:

{
    "key": "alt+/",
    "command": "-gitlens.showCommitSearch"
}

Since the alt modifier causes issues for some keyboard layouts -- what would people recommend as an alternative. Picking shortcuts keys is seemingly impossible to get right :)

I'd suggest to never use alt or shift+alt alone as modifiers, but instead always combine with ctrl and/or cmd. For an extension that introduces many key commands, I'd prefer to see chorded shortcuts using a common starting shortcut. Since VS Code itself only uses cmd+k in this way, perhaps Gitlens could use cmd+g, e.g. cmd+g c for "Show commit details".

Honestly I'm all for chords -- but I couldn't find any reasonable chords that didn't conflict with current vscode shortcuts or very popular extensions. It's like whack-a-mole. :(

Yes, it is a mess ... I've always wondered why other editors don't handle this in the same way as Textmate does, i.e. if several commands use the same shortcut, then all of them will be shown in a pick list with automatically assigned completions (1-9 as far as I remember). Anyhow, cmd+alt+g seems to be free as chord starter - or maybe it is taken by some other extension?

It would also be nice if there was some way or something where I component could offer alternative keyboard mappings -- so maybe all the alt+ works for some (i.e. me) and some alternative mappings could be offered as options. Since shortcut mappings for extensions are defined in the package.json it isn't even currently possible for extensions to offer any settings for alternatives.

I will look into the feasibility of alternates -- cmd+alt might work, would have to see how that translates on windows too.

@robsonpeixoto @lindskogen @aeinbu @larsboldt @svenax @BendingBender @christophberger @chabou

I'm looking at trying to resolve this, but I want to request some help. So right now I'm thinking of adding a new gitlens.keymap setting to control which "keymap" to use. Thinking there will be 3 options, default, alternative (needs a MUCH better name), none -- it will default to default, and alternative needs to be figured out (that's where I would like some help), and none which will stop GitLens from adding any shortcut keys

So could you all help me come up with a reasonable (cohesive) set of alternative shortcut keys that have a much less change of a) causing issues with different keyboard layouts and b) don't conflict with other popular extensions

Let's make sure we fix this too: https://github.com/eamodio/vscode-gitlens/issues/113

I like this approach, @eamodio. It'll keep working for users that are familiarised with the keymaps, and will add an option to disable

See gitlens.keymap setting under https://github.com/eamodio/vscode-gitlens/blob/master/README.md#general-settings

Use "gitlens.keymap": "chorded" for a set of shortcut keys that should not conflict. Or "gitlens.keymap": "none" to not have GitLens automatically add any shortcut keys at all.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ardeshir81 picture Ardeshir81  Â·  3Comments

dwlsalmeida picture dwlsalmeida  Â·  3Comments

batjko picture batjko  Â·  4Comments

mindpivot picture mindpivot  Â·  4Comments

carlleeswanson picture carlleeswanson  Â·  3Comments