vscode-gitlens icon indicating copy to clipboard operation
vscode-gitlens copied to clipboard

Consider using no (conflicting) keybindings as default

Open Sti2nd opened this issue 5 years ago • 2 comments

VS Code by default uses CTRL + SHIFT + G to open the Source Control View. GitLens by default uses the same key binding CTRL + SHIFT + G as a prefix to its keyboard shortcuts, resulting in that the original key binding of VS Code is lost. This can be a surprise for everyone not aware of that fact #423 . This can be fixed by adding "gitlens.keymap": "none" to settings.

I want to start a discussion about whether it is best for users to have the conflicting key bindings enabled by default or whether it would be best to have them disabled (gitlens.keymap set to none) by default.

I can start the discussion by saying it is not always easy to understand why a keyboard shortcut suddenly doesn't work and which extension disabled it. In GitLens' case it is extra difficult since searching the keybindings doesn't show that GitLens has registered that keybinding. My experience is that extending VS Code by installing extensions is very nice if it is done gradually and without side effects, and it becomes an unmanageable monster if extensions comes with too many unwanted features. GitLens has done it the correct way, I would say, with options / settings to toggle features on and off, and I forgot to turn off the keyboard shortcut. As a relatively new user I don't want all the features of GitLens turned on right now, I would rather turn them on myself when I need them.

Sti2nd avatar Apr 20 '20 14:04 Sti2nd

I was also unable to copy or paste (cmd + x/cmd + v) anything whilst focused on the file explorer. Example:

  • open file expolorer
  • select file
  • press space bar (to enter edit file name mode)
  • CMD + C
  • switch to file search tab
  • CMD + V

Expected:

  • file name is in clipboard
  • file name is pasted into search field

Actual

  • previous value is stored in clipboard
  • paste command is not executed

After disabling the key bindings with "gitlens.keymap": "none" in the settings.json the problem is resolved.

danschalow avatar Jul 21 '21 10:07 danschalow

This can be fixed by adding "gitlens.keymap": "none" to settings.

I find it worth mentioning there is another option: "gitlens.keymap": "alternate" if you still want to have GitLens features available using the keyboard.

At the same time, the “alternate” keyboard shortcuts are easier to type. For example, GitLens: Toggle File Blame has the keybinding Alt+B compared to Ctrl+Shift+G B.

The only reason I can imagine they are not default is because of Macs where the Alt aka Option key is used to type special characters (like Alt Gr on Windows or Linux).

Melebius avatar Feb 09 '24 08:02 Melebius