Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we save all files in (VSCode) like we do in Visual Studio

People also ask

How do I save a VS Code folder?

Name it whatever you want, then click on "Select Folder". It will appear in the *Visual Studio Code explorer. Now from menu File → Save Workspace As.... Name the workspace and save it wherever you want to keep all your workspaces, (not necessarily where your project folders are).


It doesn't look like VS Code has a built-in single-press keyboard shortcut to save all open files on Windows.

The simplest way would be to use the menu accelerators: ALT+F, followed by ALT+L.

Alternatively, you can change the key binding by editing the keyboard preferences:

VS Code with File menu open, Preferences, Keyboard Shortcuts highlighted

Add the binding to the right half of the screen, then restart VS Code:

// Place your key bindings in this file to overwrite the defaults
[
    { 
      "key": "ctrl+shift+s", 
      "command": "workbench.action.files.saveAll" 
    }
]

enter image description here


    ⌥+⌘+S               // macOS
    Ctrl+K S            // Windows
    Ctrl+Alt+S          // Linux

As of today you can press Ctrl + K , S to save all unsaved files currently opened in Visual Studio(VS) Code editor.

Word of caution: You need to be careful about keyboard shortcut combination present in description text of any menu item.

The trick to note here is that the command key combination Ctrl + K S shown with menu item text gives an impression that you have to press Ctrl key, keep the Ctrl key pressed and then press the keys K and S one by one in quick succession. This is not the case.

enter image description here

After having pressed Ctrl + K combination, you need to release both Ctrl and K keys and then press S key separately.

For cases where Ctrl key has to be kept pressed continuously, you'll notice that modifier keys (Ctrl or Alt) will appear twice in the menu description text e.g. to open a new folder, the menu text description reads Ctrl + K Ctrl + O as shown in the screenshot below:

enter image description here


For windows user - Visual Studio Code has Ctrl + K , S

  1. Press Ctrl key + K.
  2. Release the Ctrl and K both keys.
  3. Press S key.

This will Save all modified files in one go. Release is the main point as new user press S key with Ctrl key which opens key board shortcuts file.


For Windows users, the key shortcut is displayed as the 11th option in the "File" menu as:

Save All           Ctrl + K S

The key shortcut displayed equates to the following:

  1. Press Ctrl + k

  2. Release the Ctrl and k keys.

    Notice the bottom of your window will display a message asking for a second key like this:

VSCode bottom status message after pressing <kbd>Ctrl</kbd> + <kbd>k</kbd>.

  1. Press s.

This applies to other "Close Workspace" command that can be found in the "File" menu (instead of pressing s, you press f).


This keybindings.json switches the Save All and Save shortcuts so that Cmd+S is bound to Save All:

[
    {
        "key": "alt+cmd+s",
        "command": "workbench.action.files.save"
    },
    {
        "key": "cmd+s",
        "command": "-workbench.action.files.save"
    },
    {
        "key": "cmd+s",
        "command": "workbench.action.files.saveAll"
    },
    {
        "key": "alt+cmd+s",
        "command": "-workbench.action.files.saveAll"
    }
]

First of All, I want you to check, What is your VS Code default shortcut for 'Save All' files

Step 1: Open VS Code> 'File' Tab > 'Preferences'> ClickOn 'Keyboard Shortcuts'

Secondly, I want you to search for 'Save All' Shortcut.

Step 2: Type 'Save All' in Search Field

Third, you will see that shortcut keybinding to the 'Save All' Command.

Step 3: You can also change the keybinding to it. Just clicking on it and adding controls of your choice and then press enter.