VSCode - Importing keyboard shortcuts

前端 未结 4 2253
孤街浪徒
孤街浪徒 2021-02-19 09:10

I\'m using VSCode on Windows and Ubuntu and I\'d like to have the same keyboard shortcuts in both environment (saving my brain memory space for

相关标签:
4条回答
  • 2021-02-19 09:36

    you can use this extension Settings Sync this will sync extensions and complete User Folder that Contains

    1. Settings File
    2. Keybinding File
    3. Launch File
    4. Snippets Folder
    5. VSCode Extensions & Extensions Configurations
    6. Workspaces Folder

    it will save all setting on Github gits then you will be able on other platforms to download that setting this will keep to vscode sync it looks like visual studio kind sync but so far the configuration for the first time need little of work but it's not a big deal at totally helpful extensions

    extension features

    0 讨论(0)
  • 2021-02-19 09:50

    As an answer to a similar question, I made a VSCode extension that provides the default Windows keybindings on any platform. It is on the VSCode extension marketplace, and called Windows Default Keybindings.

    If you're happy with the Windows defaults, that should do what you want.

    If you want a different platform's bindings (Linux or Mac), you could use the same procedure I did to make that extension, namely, run "Preferences: Open Default Keyboard Shortcuts (JSON)" and stuff the result into the appropriate place in package.json in a new extension.

    0 讨论(0)
  • 2021-02-19 09:51

    TL;DR; I think use Settings Sync like Muhammed Albarmavi's answer mentioned is the way to go, I used it myself to sync between Ubuntu and Windows.


    However, I don't know if there's a difference in syncing from Linux to Macos. About Settings Sync, the idea is it uses Github Gist to store all the settings on the cloud, so that then you could use any machine to pull (download) from the cloud to replicate those settings on any new machine. With the extension, you just need to press upload/download, all the copying process is done by the extension for you.

    Details about those files store on gist, they're:

    • extensions.json
    • keybindings.json
    • keybindingsMac.json
    • settings.json
    • snippets|javascript.json
    • ...another modified settings
    • You could take a look about its shape here: https://gist.github.com/loia5tqd001/7f68a682472a018bcc75ecadeeab447b

    As you can see, there're keybindings.json and keybindingsMac.json, I would guess keybindings.json is for linux and windows, and keybindingsMac.json is for Macos, the other settings (like extensions settings) would be the same. So I myself keep syncing between Ubuntu and Windows by changing the same file keybindings.json. About syncing from Linux to MacOs, I don't know exactly what's happening under the hood, give a look at a comment here maybe you'll know. But the exactly what's happening under the hood seems to be not very important because it's taken care of by the Settings Sync itself already, so you might just try pressing upload and download, and see the changes happen.

    As you use the Settings Sync, you'll notice that you can have multiple gists, so you can have multiple versions of settings on the cloud. Maybe you'd want some gist for Windows, some for Linux/macOS or any strategy that you could think of.

    But if you want the exact same settings from the default ones to the modified ones syncing across the machines, I think that might not how it could work. But think, for example, to duplicate a line of code (copy-lines-down-action), the default key-shortcut would be Ctrl+Alt+Shift+, and it works well on Windows, but not on Ubuntu because Ctrl+Alt+Shift+ is also the default shortcut for moving between workspaces of the OS, so it'll not work on Ubuntu. The point is, the different OS is different, so you might not just copying the exact same settings from an OS to another and hope it'll work perfectly the same too easily. But I promise, using Settings Sync would not be that very painful, just a little tweak of OS-difference settings along the way, then you'll be happy.

    If you haven't known how to use Settings Sync yet, I suggest just watch a youtube video, a medium article and/or the documentation. Still, it'll be fairly easy.

    If there's a better way to sync perfectly exact settings from an OS to another btw, I would be curious to learn.

    0 讨论(0)
  • 2021-02-19 09:52

    If you want to import key bindings from other code editors like Atom or Sublime, there are plugins which you can directly install and start using. Hope that helped :)

    0 讨论(0)
提交回复
热议问题