Open kasecato opened 7 years ago
Bump
I too want this
Bump
I'd like this feature as well for the same reasons.
I can contribute. But I don't know where to get started. @alexandrudima @roblourens any guidance on where to start things ?
Yes, this feature would be really useful for us too. We are predominantly a Linux studio but we do use OSX for some dev work. It would be great when using OSX we could have the Linux key bindings if possible?
As an extension to this: should also work the other direction. ;-)
Waited for 2 years. I only have to overwrite windows keymap on mac keymap setting.
Add option to use windows keymap on Linux
Still need to be able to switch to the defaults for another OS. This would be especially useful now as a number of us have started using WSL 2 due to the performance improvements over WSL 1 but we have trained our brains on the Linux key mappings :o)
Is there somewhere you can get the other OS keymaps to just overwrite the current one manually?
I would also love this, as I use Linux for work and Windows on my private machine. This could also be implemented as an extension or multiple ones on the marketplace.
I also need this pretty bad
Yes. I just synced my parallels version of vscode to the settings I uploaded from my mac, and now It's completely unusable.
Lack of this functionality basically makes VSCode a non-starter for me on the Mac... My Mac sits right next to my PC, and if I have to memorize two sets of key bindings, I might as well stay in Xcode all the time (which makes me sad).
I also would really like this functionality, as a switch back and forth between a Mac at work and Linux at home.
I looked into the code a bit, and had some luck hardcoding some OS values, but I was getting some weird behavior. We would also want a final version of this to be configurable in the preferences/settings. Unfortunately it looked like a lot of this OS stuff is happening at too low of a level to have access to the configurationService. I'm not familiar with the vscode code base, so I might be wrong about some of this, but this at least doesn't seem like a beginner-friendly issue to fix.
I did find a potential work-around though. There's a "Preferences: Open Default Keyboard Shortcuts (JSON)" command which opens a readonly editor with all of your current OS's shortcuts. You can copy the contents of that file and then use "Preferences: Open Keyboard Shortcuts" on your other computer to open your user-defined shortcuts and paste in the other OS's defaults. You could also do that on one computer and then sync your settings. I'll try that out this weekend and see how it goes.
I've created a few extensions that should help with this. Though it would certainly be preferable to have this functionality out of the box
ext install fredhappyface.windowskeybindings
ext install fredhappyface.linuxkeybindings
Note that some keybindings may interfere with other extensions. In that case drop an issue and I'll try and fix asap
Same Request for linux, will be great if we can chose the main keymap theme on preferences, im current migrating from windows dev environment for linux and need to learn everything again.
Same request for Mac. I'm a frequent Mac user but sometimes would be using Windows when I wanna stick to my muscle memory for Mac.
Any news about this? I feel so lose working with VSC on Windows...
I would also like this feature
You could use the clause contexts isLinux
, isMac
, isWindows
and isWeb
as a workaround. For example:
"keybindings": [
{
"command": "editor.action.deleteLines",
"key": "cmd+backspace",
"when": "isMac && editorTextFocus && !editorReadonly"
},
{
"command": "editor.action.deleteLines",
"key": "ctrl+y",
"when": "!isMac && editorTextFocus && !editorReadonly"
}
]
But your suggestion with the property mac
will work too. Just use key
instead of win
:
"keybindings": [
{
"command": "editor.action.deleteLines",
"key": "ctrl+y",
"mac": "cmd+backspace",
"when": "isMac && editorTextFocus && !editorReadonly"
}
]
After working on vscode extensions I too discovered the ability to define platform-specific bindings and immediately went and replaced all the duplicated bindings I had in keybidings.json. I was rather surprised (and disappointed) when I discovered that they didn't work 🙁 Having support for { "key": "...", "mac": "...", "win": "...", "linux": "..." }
would remove the need to define and maintain otherwise identical mappings that only differ by the key
prop as well as including "when": "isX && ..."
. Maintaining these are error prone, and result in 2-4 times as many bindings having to be added and updated anytime one wants to change the command or when clause.
It's too bad a PR that implemented this was closed in favour of https://github.com/microsoft/vscode/pull/54894
Example of verbose double mapping required today (note that multiple isMac
checks are necessary):
[
{
"key": "cmd+w",
"command": "workbench.action.terminal.kill",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
"key": "ctrl+w",
"command": "workbench.action.terminal.kill",
"when": "!isMac && terminalFocus && terminalHasBeenCreated || !isMac && terminalFocus && terminalProcessSupported"
},
]
My personal keybindings.json has ~40 of these mappings, which makes it much harder to maintain and organize them. Compare this to the equivalent binding that the proposal would enable:
[
{
"key": "ctrl+w",
"mac": "cmd+w",
"command": "workbench.action.terminal.kill",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
]
While this doesn't solve the design issue in vscode, there's an extension to (partially) solve the issue. Leaving it here as it might be useful for people having the same frustrations. https://marketplace.visualstudio.com/items?itemName=smcpeak.default-keys-windows
I'm using a Mac keyboard on both MacOS and Linux. Rebinding keybinds works for most things.
I can't find a way to rebind Ctrl + Click
for opening links to command + Click
to open links.
2024 - 2017 = 7 years! Microsoft guys never use multiple OS?
@kaiwu-astro, plot twist: Microsoft devs work using MacBooks 💀
I wanted to make keybinds on Windows the same as MacOS, and got most of the way there using PowerToys:
To emulate MacOS keyboard shortcuts on Windows, use the PowerToys Keyboard Manager with the following settings:
(note that replacing left alt and left ctrl should be good enough, but to keep things short "left" is omitted from these key names below. "left" on its own means "left arrow key".)
Remap keys:
Remap shortcuts:
(note that the key remap above applies first, so alt below represents the ctrl key on the keyboard, and vice versa)
Restore switching between windows with alt + tab after key remap:
Restore switching tabs:
Move cursor to start/end of line (does not seem to require additional entries for selecting text with the addition of the shift key):
Move cursor word by word, also selecting text if shift included:
Erase word by word:
Drag text lines up and down:
Missing:
Some VSCode keybinds are the same between Windows and MacOS, and this remap will break them if they use ctrl or alt, so they need to be restored - such as with "toggle terminal" (JSON generated by VSCode after modifying keybind):
{
"key": "alt+oem_3",
"command": "workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
},
{
"key": "ctrl+oem_3",
"command": "-workbench.action.terminal.toggleTerminal",
"when": "terminal.active"
}
We can write
keybindings
inpackage.json
(Extension Manifest File).I got a request from some developers that they are using macOS but they want to use Windows keybindings. See Add option to use windows keymap on MacOS.
So, I'd like to switch
mac
andwin
insettings.json
or something. Can I do this?