How to achieve Zen in VS Code
Tags: vscode, productivity, webdev, beginners
Published: 2020-11-25 18:24:02

---
title: How to achieve Zen in VS Code
published: true
description: Let's talk about how we can make VS Code look so clean to help us achieve true Zen.
tags: [vscode, productivity, webdev, beginners]
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/i1m8ulxnwd135o4t05ya.png
series: VS Code Tips
---

You're staring at VS Code, and in front of you is this cluttered mess with random things everywhere that no-one could ever make sense of. But enough about your code, let's talk about how we can make VS Code look _so clean_ to help us achieve _true Zen_.

To start, let's go through the VS Code user interface and see how we will leverage VS Code's built-in features to hide any part of the interface that will interfere with our Zen.

Here is a video version of this post if that is more your speed:

{% youtube 0FPeRDiaK7w %}

## VS Code User Interface

The user interface is broken up into 5 parts:

- **Editor** - The main area to edit your files. You can open as many editors as you like side by side vertically and horizontally.
- **Side Bar** - Contains different views like the Explorer to assist you while working on your project.
- **Status Bar** - Information about the opened project and the files you edit.
- **Activity Bar** - Located on the far left-hand side, this lets you switch between views and gives you additional context-specific indicators, like the number of outgoing changes when Git is enabled.
- **Panels** - You can display different panels below the editor region for output or debug information, errors and warnings, or an integrated terminal. Panel can also be moved to the right for more vertical space.

![vs code user interface](https://dev-to-uploads.s3.amazonaws.com/i/5grnovtpow1gekqawid5.png)

VS Code has a ton of different panels, bars, and groups because VS Code can do so many things!

We will take a look at hiding these parts one by one but first let's look at a feature of VS Code that will hide everything except the editor, called _Zen Mode._

## Zen Mode

From the VS Code docs, "Zen Mode lets you focus on your code by hiding all UI except the editor (no Activity Bar, Status Bar, Side Bar and Panel), going to full screen and centering the editor layout."

Zen Mode in VS Code looks like this:

![vs code's default zen mode](https://dev-to-uploads.s3.amazonaws.com/i/l6pgjz5bw3qwo57pjmt1.png)

This is a great built-in feature that also allows us to customize this mode to our liking.

Some recommended tweaks would be to disable making VS Code fullscreen and disable centering the layout. This way you can be in Zen Mode and still control the size and position of your VS Code window.

You can disable fullscreen and center layout by adding the following to your `settings.json` by running the command (`cmd + shift + p`) _Preferences: Open Settings (JSON)_:

```json
"zenMode.fullScreen": false,
"zenMode.centerLayout": false,
```

Or you can open the UI for settings by running the command (`cmd + shift + p`) _Preferences: Open Settings (UI)_ and searching for "Zen Mode" to uncheck those two options.

With Zen Mode and a couple of custom configurations, we are 90% of the way to our ultimate goal of a completely zen VS Code experience.

Before we make the last 10% let's go over what is hidden when we toggle Zen Mode.

## What does Zen Mode hide?

By default, Zen Mode hides every part of the user interface except the Editor. Let go through each part and how you can hide them yourself without toggling Zen Mode. This can be helpful if you just need one or two parts of the user interface out of your way instead of everything but the editor.

### Activity Bar and Side Bar

![vs code user interface with activity bar and side bar highlighted](https://dev-to-uploads.s3.amazonaws.com/i/jrlqgasanhkctx2pjbc6.png)

These are the two parts on the left of the user interface.

The Activity Bar can be hidden by running the command (`cmd + shift + p`) _View: Toggle Activity Bar Visibility._

There is not a default keyboard shortcut set but you can always set one that works for you.

The Side Bar can be hidden by running the command (`cmd + shift + p`) _View: Toggle Side Bar Visibility._

The default keyboard shortcut for this is `cmd + b`

### Panel and Status Bar

![vs code user interface with panel and status bar highlighted](https://dev-to-uploads.s3.amazonaws.com/i/515suoaslghglkn6yaqv.png)

These are the two parts at the bottom of the user interface.

The _Panel_ can be hidden by running the command (`cmd + shift + p`) _View: Toggle Panel._

The default keyboard shortcut for this is `cmd + j`

The _Status Bar_ can be hidden by running the command (`cmd + shift + p`) _View: Toggle Status Bar Visibility._

There is not a default keyboard shortcut.

## The last 10% to zen

The default Zen Mode has us 90% of the way to complete Zen but there are a few user interface elements that are still in our way.

Those elements are the _Minimap_ and _Indent Guides._ So let's look at how to hide them.

### Minimap

![vs code user interface with minimap highlighted](https://dev-to-uploads.s3.amazonaws.com/i/yze7i69o58o1hly02u3w.png)

The _Minimap_ is inside the editor part on the right-hand side and gives a zoomed-out look of the file you have open.

The _Minimap_ can be hidden by running the command (`cmd + shift + p`) _View: Toggle Minimap._

There is not a default keyboard shortcut.

### Indent Guides

![vs code user interface with indent guides highlighted](https://dev-to-uploads.s3.amazonaws.com/i/1xjg5dql3yqdrkjybk1a.png)

_Indent Guides_ are thin vertical lines that show an indent in your file.

Unfortunately, these still show up in the default Zen Mode because they have to be disabled in settings like this `"editor.renderIndentGuides": false,`.

We don't want them off all the time so we will need a way to toggle the _Minimap_ and _Indent Guides_ when going into Zen Mode.

### Toggle Minimap and Indent Guides

To be able to toggle the _Minimap_ and _Indent Guides_ when we toggle Zen Mode we will have to install two extensions.

[Settings Cycler](https://marketplace.visualstudio.com/items?itemName=hoovercj.vscode-settings-cycler) and [multi-command](https://marketplace.visualstudio.com/items?itemName=ryuta46.multi-command).

These allow us to set up settings to toggle and give us the ability to run multiple commands with one keybinding.

To oversimplify these steps, after you install these two extensions you can add this snippet to your `settings.json`

```json
// multiCommand
"multiCommand.commands": [
    {
        "command": "multiCommand.betterZenMode",
        "sequence": [
         "workbench.action.toggleZenMode",
         "settings.cycle.zenModeExtras",
        ]
    },
],
// Settings cycle
"settings.cycle": [
{
    "id": "zenModeExtras",
    "values": [
            {
                "editor.lineNumbers": "off",
                "editor.folding": false,
                "editor.renderIndentGuides": false,
                "editor.minimap.enabled": false,
            },
            {
                "editor.lineNumbers": "on",
                "editor.folding": true,
                "editor.renderIndentGuides": true,
                "editor.minimap.enabled": true,
            }
        ]
    }
],
```

And this snippet to your `keybindings.json`

```json
{
 "key": "cmd+k z",
 "command": "extension.multiCommand.execute" ,
 "args": { "command": "multiCommand.betterZenMode" },
},
```

## Conclusion: A Better Zen Mode

With everything set up, when we use the keybinding `cmd + k z` our VS Code editor will go into our new _Better Zen Mode_ that looks like this.

![vs code custom zen mode or better zen mode](https://dev-to-uploads.s3.amazonaws.com/i/xjt0lwvyz8qa8d8qtrqo.png)

Combining the current Zen Mode and our custom configurations we can achieve complete zen when viewing our code. Making the code look good, we will leave to you.

And here is a comparison of the normal editor, Zen Mode editor, and our Better Zen Mode editor.

![comparison between normal, zen mode, and the new custom better zen mode](https://dev-to-uploads.s3.amazonaws.com/i/ykjw3yjz77glrlhuhxir.png)

## 🌟 Thanks! 🌟

Thank you for reading! Let me know what you think of this _Better Zen Mode_ and any tips you have around making VS Code look great.

You can follow me on Twitter if you're looking for some more content: 

[https://twitter.com/TheMrHolliday](https://twitter.com/TheMrHolliday)

If a blog is more your thing here is that as well:

[https://koalatea.io/](https://koalatea.io/)