How can we save all files in (VSCode) like we do in Visual Studio
Visual StudioKeyboard ShortcutsVisual Studio-CodeVisual Studio Problem Overview
How can we save all the files in Visual Studio Code like we do in Visual Studio by pressing Ctrl+Shift+S ?
Visual Studio Solutions
Solution 1 - Visual Studio
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:
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" }]
Solution 2 - Visual Studio
⌥+⌘+S // macOS
Ctrl+K S // Windows
Ctrl+Alt+S // Linux
Solution 3 - Visual Studio
TL;DR; You can press Ctrl + K , S to save all open files with a little caveat associated with it.
Details: Please be careful about keyboard shortcut combination shown in any menu description. There is a little caveat about it. The combination Ctrl + K S shown as menu description text gives an impression that we 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.
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 will appear twice in the menu description text. For example, to open a new folder, the menu item's text shows Ctrl + K Ctrl + O. In this case Ctrl modifier key is present twice as shown in the screenshot below:
Solution 4 - Visual Studio
For windows user - Visual Studio Code has Ctrl + K , S
- Press Ctrl + K.
- Release the Ctrl and K both keys.
- 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.
Solution 5 - Visual Studio
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:
-
Press Ctrl + k
-
Release the Ctrl and k keys.
Notice the bottom of your window will display a message asking for a second key like this:
- Press s.
This applies to other "Close Workspace" command that can be found in the "File" menu (instead of pressing s, you press f).
Solution 6 - Visual Studio
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" }]
Solution 7 - Visual Studio
> 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.
Solution 8 - Visual Studio
I'm a jack of all trades developer, using lots of different tools and operating systems. I'm always nervous about blindly using keystrokes. I much prefer to use a simple "save all" button.
If you add "Open Editors" in your VS Code Explorer window, that selection includes a very handy "Save All" icon. Click the icon, and you are done.
No custom keystrokes required. No preferences to edit.
Solution 9 - Visual Studio
As of May 2020 (version 1.46) In Mac the shortcut key is:
> Option + Command + s
Solution 10 - Visual Studio
To save all the files in VSCode(Windows),
Press Ctrl+K then Press the S.
All files will be saved.
To find other keyboard shortcuts or to change a shortcut,
Go to File -> Preferences -> Keyboard Shortcuts OR Press Ctrl+K+S
Select a keyboard shortcut and press Enter to update/change a keybinding
Solution 11 - Visual Studio
ctrl + shift + s
Is supported in latest versions My version is: 1.39.1