Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing path in file-tabs in Visual Studio Code

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

like image 557
Drkawashima Avatar asked Sep 20 '16 15:09

Drkawashima


People also ask

How do I display tabs in VS Code?

How do you show space and tab in Visual Studio code? In Visual Studio for Windows, to display whitespace characters (tabs, spaces, etc) you simply press Ctrl + R, Ctrl + W.

How do I view tabs in Visual Studio?

The keyboard shortcut is CTRL + R , CTRL + W . The command is called Edit. ViewWhiteSpace . It works in all Visual Studio versions at least since Visual Studio 2010, the current one being Visual Studio 2019 (at time of writing).

How do I open a path in Visual Studio?

On the Visual Studio menu bar, choose File > Open > Folder, and then browse to the code location. On the context (right-click) menu of a folder containing code, choose the Open in Visual Studio command. Choose the Open Folder link on the start window.


2 Answers

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.

like image 118
Drkawashima Avatar answered Sep 26 '22 18:09

Drkawashima


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.

like image 22
ValRob Avatar answered Sep 22 '22 18:09

ValRob