Showing path in file-tabs in Visual Studio Code

Visual Studio-Code

Visual Studio-Code Problem Overview


I've got a component-based folder structure in my project. It is a bunch of component-folders with one index.js file each.

Is it possible to make Visual Studio Code display the parent folder name in the file tabs? Or am I limited to seeing a bunch of tabs that all display index.js and nothing else?

Enter image description here

Visual Studio-Code Solutions


Solution 1 - Visual Studio-Code

You can configure Visual Studio Code to always show parent folder names in the tabs! In your User Settings, just add this line: "workbench.editor.labelFormat": "short" (other values are "long", "medium" or "default")

Result: the files init/views.js, init/routes.js and plugins/modal.js will be presented as such:

Screenshot of Visual Studio Code file tabs


Another option is the User Setting "breadcrumbs.enabled": true which will give you an entire row of breadcrumbs showing the complete file path:

Screenshot of breadcrumbs


PS: To open User Settings use the File-menu → PreferencesSettingsUser Settings. To view the settings in a JSON format just click the {} icon in the top right corner.

Solution 2 - Visual Studio-Code

Go to the main menu FilePreferencesSettings. And search for (Cmd + F on Mac; Ctrl + F on Windows and Linux) workbench label format.

Choose the short option.

Solution 3 - Visual Studio-Code

Visual Studio Code has now improved their tab-UI to resolve this issue.

When you've opened multiple tabs with the same filename, Visual Studio Code will automatically display the parent foldername in each of those tabs.

Here's an example: I've opened event.js and two index.js files. Visual Studio Code automatically decides it's a good idea to display the foldername for the index.js files :)

It pretty much solved the bulk of my problem.

Solution 4 - Visual Studio-Code

I know this is too late to answer, but in case someone is looking for the file path to show on the title bar, you can follow this:

  1. Open settings (command + ,)
  2. Search for title
  3. You'll see something like activeEditorShort, replace it with activeEditorLong
  4. Save

Source: https://medium.com/riow/vscode-show-full-path-in-title-bar-b0cb731b330

Solution 5 - Visual Studio-Code

If you are looking for enable tabs you could see this Link Have how change Tabs for json or normal tab that is default

Solution 6 - Visual Studio-Code

You can install the nice-index extension for a better experience dealing with index files.

However, as of now, it only works when you have more than one index file open. This can be resolved by changing labelFormat to "short", as other answers suggest.

Solution 7 - Visual Studio-Code

In VSCode 1.53 you can use thees settings:

Controls the window title based on the active editor. Variables are substituted based on the context:

${activeEditorShort}: the file name (e.g. myFile.txt).
${activeEditorMedium}: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt).
${activeEditorLong}: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt).
${activeFolderShort}: the name of the folder the file is contained in (e.g. myFileFolder).
${activeFolderMedium}: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder).
${activeFolderLong}: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder).
${folderName}: name of the workspace folder the file is contained in (e.g. myFolder).
${folderPath}: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder).
${rootName}: name of the opened workspace or folder (e.g. myFolder or myWorkspace).
${rootPath}: file path of the opened workspace or folder (e.g. /Users/Development/myWorkspace).
${appName}: e.g. VS Code.
${remoteName}: e.g. SSH
${dirty}: a dirty indicator if the active editor is dirty.
${separator}: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.

Solution 8 - Visual Studio-Code

I've created a simple Visual Studio Code plugin which accepts a list of regexes and colors and changes the titleBar/tabColor based on them. It's great for working on mono repositories or large projects with multiple packages (like Lerna, or React + React Native).

ColorTabs

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDrkawashimaView Question on Stackoverflow
Solution 1 - Visual Studio-CodeDrkawashimaView Answer on Stackoverflow
Solution 2 - Visual Studio-CodeValRobView Answer on Stackoverflow
Solution 3 - Visual Studio-CodeDrkawashimaView Answer on Stackoverflow
Solution 4 - Visual Studio-CodeJieView Answer on Stackoverflow
Solution 5 - Visual Studio-CodeRoytman PiccoliView Answer on Stackoverflow
Solution 6 - Visual Studio-CodeVitexikoraView Answer on Stackoverflow
Solution 7 - Visual Studio-CodeAlexander ShestakovView Answer on Stackoverflow
Solution 8 - Visual Studio-CodeoreporView Answer on Stackoverflow