我们如何将所有文件保存在 (VSCode) 中,就像我们在 Visual Studio 中所做的那样

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

我们如何像在 Visual Studio 中那样通过按 Ctrl+Shift[= 来保存 Visual Studio 代码中的所有文件17=]+S ?

看起来 VS Code 没有内置的单击键盘快捷键来保存 Windows 上所有打开的文件。

最简单的方法是使用菜单加速器:ALT+F,然后是 ALT+L.

或者,您可以通过编辑键盘首选项来更改键绑定:

将绑定添加到屏幕的右半边,然后重新启动 VS Code:

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

++S // macOS

Ctrl+K S // Windows

Ctrl+Alt+S // Linux

TL;DR; 你可以按 Ctrl + K , S 保存所有打开的文件,并带有一个 little 警告。

详情:请注意任何菜单描述中显示的键盘快捷键组合。有一个 little 警告。 Ctrl + K S 显示为菜单描述文本的组合给人的印象是我们必须按 Ctrl 键,按住 Ctrl 键,然后按 KS 键 一个接着一个。 不是这种情况。

按下Ctrl+K组合键后,需要松开CtrlK键,然后分别按S键。

对于必须连续按住 Ctrl 键的情况,您会注意到修改键会在菜单描述文本中出现两次。例如,要打开一个新文件夹,菜单项的文本显示 Ctrl + K Ctrl + O。在这种情况下,Ctrl 修改键出现两次,如下面的屏幕截图所示:

此 keybindings.json 切换 Save AllSave 快捷方式,以便 Cmd+S绑定到 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"
    }
]

对于 windows 用户 - Visual Studio 代码有 Ctrl + K , S

  1. Ctrl + K
  2. 松开 CtrlK 两个键。
  3. S键。

这将一次性保存所有修改过的文件。释放是新用户按 S 键和 Ctrl 键打开键盘快捷方式文件的要点。

对于 Windows 用户,快捷键显示为 "File" 菜单中的第 11 个选项:

Save All           Ctrl + K S

显示的快捷键等同于以下内容:

  1. Ctrl + k

  2. 松开 Ctrlk 键。

    请注意,您的 window 底部会显示一条消息,要求提供第二个密钥,如下所示:

  1. s

这适用于可以在 "File" 菜单中找到的其他 "Close Workspace" 命令(不是按 s,而是按 f).

ctrl + shift + s

最新版本支持 我的版本是:1.39.1

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.

截至 2020 年 5 月(版本 1.46) 在Mac中快捷键是:

Option + Command + s

保存VSCode(Windows),

中的所有文件

Ctrl+K然后按S.

将保存所有文件。

要查找其他键盘快捷方式或更改快捷方式,

转到 文件 -> 首选项 -> 键盘快捷键 或按 Ctrl+K+S

Select 键盘快捷键并按 Enter 到 update/change 键绑定

我是一名多面手,使用过许多不同的工具和操作系统。我总是对盲目地使用击键感到紧张。我更喜欢使用简单的“全部保存”按钮。

如果您在 VS Code 资源管理器中添加“打开编辑器”window,该选择包括一个非常方便的“全部保存”图标。点击图标,大功告成。

无需自定义击键。没有要编辑的首选项。