VS Code is a unbelievable editor till you understand that a number of the default settings aren’t optimized for many of us coders. I have been tweaking VS Code settings to see how I might flip this favourite code editor of ours right into a extra refined model that causes much less annoyance whereas coding. These modifications take about 10 minutes to arrange. However when you do, VS Code feels quicker, calmer, and far simpler to belief.
To observe alongside, you may be tweaking the “settings.json”, a JSON file of VS Code. To try this, open the Command Palette with Ctrl+Shift+P on Home windows or Cmd+Shift+P on Mac. Within the search bar, sort “JSON” with out the quotes. Click on on “Preferences: Open Consumer Settings (JSON).” Any JSON you see within the upcoming sections, you may paste them contained in the curly braces on this JSON file.
Auto save
No must have a saving OCD after typing each line
For those who’re hitting Ctrl+S each few seconds, you’re not alone. It’s muscle reminiscence at this level. Nevertheless it’s additionally pointless friction. Auto Save removes that fully. Here is the setting:
“recordsdata.autoSave”: “afterDelay”,
“recordsdata.autoSaveDelay”: 1000
Now your recordsdata save robotically after a brief pause. You write code, pause for a second, and it’s saved. It sounds small, however it modifications how coding feels.
There have been situations the place I forgot to avoid wasting a file in a big codebase. Because of this, my new code was not working in my checks. I used to be doing all the pieces I might to repair the issue, solely to find that there have been unsaved recordsdata. That is once I discovered how helpful auto-save may be.
For those who favor a bit extra management, you need to use:
“recordsdata.autoSave”: “onFocusChange”
This protects recordsdata whenever you swap tabs or depart the editor. It is nice in case you’re working with scripts or duties the place timing issues.
Associated
Why everybody ought to use VS Code (even when they don’t seem to be programmers)
It is greater than only a code editor.
Format on save
Clear code robotically
Messy formatting is a type of belongings you discover simply sufficient to be irritated by however not sufficient to repair each time. That’s the place format on save is available in.
“editor.formatOnSave”: true
Now each time you save a file, VS Code codecs it for you. Indentation, spacing, alignment, it simply fixes itself. That is nice whenever you’re writing HTML pages, and the indentation could make these actually laborious to learn. Manually fixing them is time-consuming and cumbersome.
For those who’re utilizing Prettier (which I extremely advocate for frontend growth), you can also make it your default formatter:
“[javascript]”: {
“editor.defaultFormatter”: “esbenp.prettier-vscode”
}
Auto-formatting removes the necessity for handbook cleansing to be able to code persistently. You’ll be able to cease eager about model solely.
Phrase wrap
By no means scroll sideways once more
Horizontal scrolling is likely one of the quickest methods to interrupt your movement. You’re studying an extended line, it disappears off the display, and all of a sudden you’re dragging the scrollbar backwards and forwards making an attempt to piece issues collectively.
Simply activate phrase wrap:
“editor.wordWrap”: “on”
Lengthy strains now wrap naturally inside the editor window, making all the pieces simpler to learn, particularly JSON, logs, markdown, and JSX. The subsequent time you must learn an extended line, no want to achieve out in your mouse once more. For those who don’t need it on on a regular basis, there’s additionally a fast toggle. Flip it off utilizing Alt+Z.
Scale back visible noise
Minimap, breadcrumbs, hints
VS Code tries to be useful by exhibiting you all the pieces: a minimap, breadcrumbs, inline hints, and extra. However extra data isn’t at all times higher. Typically it’s simply noise. In case your editor feels visually busy, strive turning just a few issues off:
“editor.minimap.enabled”: false,
“breadcrumbs.enabled”: false,
“editor.inlayHints.enabled”: “off”
This strips the interface all the way down to what really issues: the editor and your code. For those who favor a minimalist setup, this could be a game-changer.
That mentioned, this one is private. Some folks love the minimap or breadcrumbs. However in case you’ve by no means questioned them, it’s price making an attempt a cleaner setup. You may discover it surprisingly refreshing.
Associated
VS Code vs. VSCodium: How completely different is the open supply model?
There’s much more to those two than only a title change.
IntelliSense management
Make autocomplete much less annoying
Autocomplete is nice, till it isn’t. By default, VS Code could be a bit over-eager. Options pop up when you’re typing strings, writing feedback, or simply pondering via one thing. It begins to really feel much less like assist and extra like an interruption.
You’ll be able to tone it down with:
“editor.quickSuggestions”: {
“different”: true,
“feedback”: false,
“strings”: false
},
“editor.suggestOnTriggerCharacters”: false
This retains solutions the place they’re helpful, just like the precise code, and removes them the place they’re distracting, resembling feedback and strings. The outcome? Autocomplete feels extra intentional. It exhibits up whenever you want it.
Make VS Code really feel like your editor
None of those settings is revolutionary. They’ve been there the entire time. However collectively, they take away a stunning quantity of labor. Apparently, VS Code has many different such hidden options that make coding extra pleasurable and make you a greater programmer.

