Become more efficient by changing the title of VSCode

Do you know the feeling when you have a lot of VS Code editors open, each pointing to its own folder, where you need to do a lot of context switching? There are several ways to find the correct VSCode window:

  • Alt-Tab
  • Hovering over the VS code icon in the windows taskbar
  • ...

In both cases, you have to 'hope' that you find the correct window soon as it is rather hard to find the correct window based on the window title. The way that VSCode is configured by default, is that the window title has a pattern that starts with the name of the currently active file. To me, this is very time consuming and this doesn't make sense as I don't know the names of all the files in a given directory. That is why looked for a better way of working and now that I have found it, I do want to share it with you:

In VS Code, you can open the settings window via one of the following methods:

  1. Click: 'File' ➡️ 'Preferences' ➡️ 'Settings'
  2. The following key combination: Ctrl + , (comma)

This results in the view below (color/theme might be different):

Opening VSCode Settings

In the search bar, type Windowtitle (nr. 1 below), then you should see something like this:

Finding the VS Code Setting

The text field close to nr. 2 represents the window title. by default, it looks a bit like this:

The original value

${dirty}${activeEditorShort}${separator}${rootName}${separator}${appName}

In my case, I changed it to the example below:

${rootName}${separator}${dirty}${activeEditorShort}${separator}${appName}

As you can see, I even excluded the ${activeeditorshort} value as I find it useless to have it visible in the window title. In my head, the 'active tab' is responsible for that. If you need more info on what you can do, just take a look at the list of predefined variables that you can use. It should cover a lot of the possible scenarios!

It is of course completely up to you to form the window title however you want! Now that you have the means to do so, you can go wild! 😄

Enjoy!

comments powered by Disqus