在Vscode中显示Git Worktree名称名称

发布于 2025-01-23 06:59:48 字数 245 浏览 2 评论 0原文

因此,我最近开始使用Git工作室,它们是神奇的。

但是,当与Visual Studio代码一起使用时,您将在顶部显示当前的分支名称(my_branch),因此当您打开超过1个项目时(在我的情况下,我有4个不同的项目交互彼此之间)具有相同的分支名称,您会感到困惑,并且必须浏览文件以了解您打开的项目。

有什么方法可以显示2个文件夹名称,例如my_project.git/my_branch

So I've recently started using git worktrees and they are magical.

But when using with Visual Studio Code, you will have the current branch name shown on the top (my_branch), so when you've opened more than 1 project (in my case I have 4 different projects interacting with each other) with the same branch name, you would get confused and have to browse the files to know which project you've opened.

is there a way I can show 2 levels of folder names, like my_project.git/my_branch?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吃颗糖壮壮胆 2025-01-30 06:59:48

Visual Studio代码的窗口标题可以如下编辑:

  1. nofollow noreferrer“> open settings.json ,在工作区或用户范围
  2. 添加“ window.title”:“ $ {rootpath} $ {sapeator} $ {activeedeDitormedium}”并保存文件。这将导致一个相当长的标题,但是Afaik没有一个很好的方法可以将父文件夹的名称仅能进入标题。

标题中的可用变量是(从vscode复制):

Window: Title
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}: an indicator for when the active editor has unsaved changes.
${separator}: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.

The window title of Visual Studio Code can be edited as follows:

  1. Open settings.json, in either workspace or user scope
  2. Add "window.title": "${rootPath}${separator}${activeEditorMedium}" and save the file. This will result in a rather long title, but AFAIK there is no pretty way to get just the parent folder's name into the title.

Available variables in the title are (copied from VSCode):

Window: Title
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}: an indicator for when the active editor has unsaved changes.
${separator}: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文