We can write keybindings in package.json (Extension Manifest File).
"keybindings": [
{
"win": "ctrl+y",
"mac": "cmd+backspace",
"linux": "ctrl+y",
"command": "editor.action.deleteLines",
"when": "editorTextFocus && !editorReadonly"
}
]
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 and win in settings.json or something. Can I do this?
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.
Most helpful comment
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
Note that some keybindings may interfere with other extensions. In that case drop an issue and I'll try and fix asap