gitkraken / vscode-gitlens

Supercharge Git inside VS Code and unlock untapped knowledge within each repository — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more
http://gitkraken.com/gitlens
Other
9.02k stars 1.34k forks source link

Avoid `⎇ + any` shortcuts because of conflicts with different keyboard layouts #104

Closed robsonpeixoto closed 6 years ago

robsonpeixoto commented 7 years ago

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.

lindskogen commented 7 years ago

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

aeinbu commented 7 years ago

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

larsboldt commented 7 years ago

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

Is it possible to reassign this?

eamodio commented 7 years ago

@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"
}
eamodio commented 7 years ago

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 :)

svenax commented 7 years ago

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".

eamodio commented 7 years ago

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. :(

svenax commented 7 years ago

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?

eamodio commented 7 years ago

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.

eamodio commented 7 years ago

@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

eamodio commented 7 years ago

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

robsonpeixoto commented 6 years ago

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

eamodio commented 6 years ago

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.

github-actions[bot] commented 3 years ago

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.