在 Visual Studio Code 的文件选项卡中显示路径 [英] Showing path in file-tabs in Visual Studio Code

查看:56
本文介绍了在 Visual Studio Code 的文件选项卡中显示路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目中有一个基于组件的文件夹结构.它是一堆组件文件夹,每个文件夹都有一个 index.js 文件.

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

是否可以让 Visual Studio Code 在文件选项卡中显示父文件夹名称?还是我只能看到一堆都显示 index.js 而没有别的选项卡?

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?

推荐答案

您可以将 Visual Studio Code 配置为始终在选项卡中显示父文件夹名称!在您的用户设置中,只需添加以下行:"workbench.editor.labelFormat": "short"(其他值为long"、medium"或default")

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")

结果:文件 init/views.jsinit/routes.jsplugins/modal.js 将这样呈现:

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

另一个选项是用户设置 "breadcrumbs.enabled": true 这会给你一整行面包屑,显示完整的文件路径:

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

PS:要打开用户设置,请使用文件菜单 → 首选项设置用户设置.要以 JSON 格式查看设置,只需点击右上角的 {} 图标.

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.

这篇关于在 Visual Studio Code 的文件选项卡中显示路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆