Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To save a file in Visual Studio Code, choose File > Save, or press Ctrl+S on Windows/Linux or Cmd+S on macOS. The dot on the editor tab disappears when the latest changes have been written to disk.

VS Code uses explicit saving by default, but you can also use Save As, Save All, Auto Save, and Hot Exit depending on how you work.

Save the file you are editing

  1. Open an existing file, or create a new file with File > New Text File.
  2. Enter or modify your code.
  3. Run File > Save, press Ctrl+S on Windows or Linux, or press Cmd+S on macOS.
  4. Check the editor tab. A dot indicates unsaved changes; after a successful save, the dot disappears. The Explorer may also show a badge for a modified file.

VS Code’s documented default is to require an explicit action to save changes to disk. Saving writes the current contents to the file’s existing path; it does not create a second copy.

Keyboard shortcuts at a glance

Action Windows/Linux macOS What it does
Save Ctrl+S Cmd+S Writes the active editor to its current path
Save As Ctrl+Shift+S Shift+Cmd+S Chooses a new name or location
Save All Ctrl+K, then S Option+Cmd+S Writes every modified open editor

On Windows/Linux, Ctrl+K, then S means press and release Ctrl+K, then press S; it is a two-step chord rather than four keys held simultaneously.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Amazon Basics Wired QWERTY Keyboard, Works with Windows, Plug and Play, Easy to Use with Media Control, Full-Sized, Black
  • KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
  • EASY SETUP: Experience simple installation with the USB wired connection
  • VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
  • SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
  • FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.

Save a new file

A new editor has no path until you save it. Use one of these methods:

  1. Open File > Save or press the normal Save shortcut.
  2. When the file picker appears, browse to the project folder.
  3. Enter a filename, including the extension when your project relies on one (for example, app.py, index.html, or styles.css).
  4. Select Save.

After the first save, ordinary Ctrl+S or Cmd+S writes to that path without asking again. If the file type is not recognized, VS Code may initially treat it as Plain Text; choose a language mode from the status bar if you need syntax highlighting, linting, or formatting.

Use Save As for another name or folder

File > Save As (Ctrl+Shift+S on Windows/Linux; Shift+Cmd+S on macOS) creates a copy at a path you select. It is the right command when you want to:

  • change a filename or extension;
  • move a working copy to another folder;
  • save a template without overwriting the original; or
  • create a second version before making risky edits.

Saving normally overwrites the existing file at its current path. Save As changes the active editor’s path to the newly selected file, so later saves go to that new location.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Save every modified file with Save All

When several tabs contain unsaved edits, use the Command Palette (View > Command Palette) and run File: Save All, or use the Save All shortcut: Ctrl+K, S on Windows/Linux or Option+Cmd+S on macOS.

Rank #2
Sale
Logitech MK270 Full Size Wireless Keyboard and Mouse Combo - Black
  • Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
  • Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
  • Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
  • Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
  • Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites

Save All writes each modified open editor. It does not save every file on disk in your project; files that are closed or unchanged are not part of the operation.

Turn on Auto Save

For automatic saving, choose File > Auto Save. That menu item toggles the current setting. To control when saving occurs, open Settings with File > Preferences > Settings on Windows/Linux or Code > Settings on macOS, search for files.autoSave, and select a mode.

Auto Save modes

Value Trigger Best fit
off No automatic save Workflows that require deliberate checkpoints
afterDelay Saves after you stop typing for the configured delay Most coding and note-taking workflows
onFocusChange Saves when the editor loses focus People who switch between files frequently
onWindowChange Saves when the VS Code window loses focus People who want a save before switching applications

The documented default for files.autoSaveDelay is 1,000 milliseconds when using afterDelay. You can set a different delay in milliseconds in Settings.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set Auto Save in settings.json

Open the Command Palette, run Preferences: Open User Settings (JSON), and add:

{
  "files.autoSave": "afterDelay",
  "files.autoSaveDelay": 1000
}

Settings can be applied at the user level for every project, at the workspace level for one project, or in a language-specific scope. For example, you can keep Auto Save enabled generally while disabling it for one language:

Rank #3
Sale
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
  • All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
  • Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
  • Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
  • Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
  • Plastic parts in K120 include 51% certified post-consumer recycled plastic*
{
  "files.autoSave": "afterDelay",
  "[python]": {
    "files.autoSave": "off"
  }
}

Language-specific settings are useful when automatic writes could trigger expensive builds, code generation, or tools that react to every file change.

Manual Save versus Auto Save

Consideration Manual Save Auto Save
User control You choose the exact checkpoint VS Code writes according to a trigger
Timing Immediate after the shortcut or menu command Delay, focus change, or window change
Risk Unsaved work remains if you forget Partial edits may be written while you are still experimenting
Useful for Careful, checkpoint-based work Long editing sessions and scratch files

Auto Save does not replace source control. Use Git or another version-control system for intentional history, review, and rollback.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What happens if VS Code closes unexpectedly?

VS Code’s Hot Exit backs up unsaved changes so they can be restored after an unexpected close. Its behavior is configurable with files.hotExit. Hot Exit is recovery support, not a substitute for deliberately saving: a backup may not represent the exact checkpoint you intended, and it does not replace a saved file on disk.

Troubleshoot saving problems

The tab still has a dot

Press the platform shortcut again and watch for an error notification. If the dot remains, the write did not complete. Check whether the file picker is waiting for a filename, whether a confirmation dialog is behind another window, or whether the path is writable.

“Unable to write file” or permission denied

  • Use File > Save As and choose a folder you own, such as your project directory.
  • Check that the file is not read-only and that another program has not locked it.
  • On a remote, network, or container workspace, verify that the connection is still active and that the remote account has write permission.

The file is saved with the wrong extension

Run Save As and type the complete filename, including its extension. Then select the correct language mode from the status bar. A language mode changes editing behavior; it does not rename the file.

Rank #4
Redragon K521 Upgrade Rainbow LED Gaming Keyboard, 104 Keys Wired Mechanical Feeling Keyboard with Multimedia Keys, One-Touch Backlit, Anti-Ghosting, Compatible with PC, Mac, PS4/5, Xbox
  • 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
  • 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
  • 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
  • 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
  • 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use

Auto Save is not firing

Confirm that files.autoSave is not off, and check whether a workspace or language-specific setting overrides your user setting. With afterDelay, wait longer than files.autoSaveDelay after your last edit. Focus-based modes do not save merely because a delay elapsed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Several files need saving

Use Save All rather than repeatedly switching tabs. If one file cannot be written, read the notification carefully; fix that file’s path or permissions and run Save All again.

Changes returned after a crash

Use the restored editor contents, compare them with the file on disk, and deliberately save once you confirm the recovery is correct. Hot Exit restoration can contain work that had never been written to the original path.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your VS Code project needs repeatable website screenshots, ScreenshotNeo can capture a URL with one HTTP request instead of requiring you to configure a browser. Before capture it accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and whether the request was billed. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

See the complete parameter reference in the ScreenshotNeo documentation. The basic request returns a WebP image:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo supports full-page and element captures, device presets and custom viewports, retina scale, PDF options, custom CSS and JavaScript, click and wait actions, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous webhooks, bulk requests for up to 100 URLs, usage reporting, and an OpenAPI specification. Its parameter names are compatible with those used by other screenshot APIs, which can simplify migration.

Best Value
Sale
Logitech K270 Full Size Wireless Keyboard for Windows - Black
  • All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
  • Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
  • Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
  • Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
  • Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later

Every plan includes all features: 1,000 screenshots per month free with no card; paid plans start at $5 for 3,000 screenshots. Create a free ScreenshotNeo account to try it.

FAQ

Does VS Code save automatically by default?

No. The default requires an explicit Save command, although you can enable Auto Save from the File menu or Settings.

Does Save All save closed files?

No. It writes modified editors that are currently open. Closed or unchanged files are not included.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I recover a file I never saved?

Hot Exit may restore unsaved editor contents after an unexpected close, but recovery is not guaranteed as a permanent file. Save deliberately once the recovered content is correct.

Quick Recap

Bestseller No. 1
SaleBestseller No. 3
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Plastic parts in K120 include 51% certified post-consumer recycled plastic*; Product carbon footprint: 4.02 kg CO2e
$12.34
SaleBestseller No. 5
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Plastic parts in K270 include 38% certified post-consumer recycled plastic; Eight hot keys: For instant access to the Internet, e-mail, music volume and more
$21.48

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.