如何阻止 VSCode 从侧边栏移动到当前文件所在的文件夹? [英] How do I stop VSCode from the Side Bar moving to the folder that the current file is in?

查看:58
本文介绍了如何阻止 VSCode 从侧边栏移动到当前文件所在的文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Visual Studio Code 中,每当我关闭文件时,下一个打开的文件在编辑器中都会变为活动状态,并且侧边栏会移动到文件夹结构中该文件的位置.这通常不是我想要的行为.我经常想在刚刚关闭的文件所在的位置打开另一个文件,但现在我的侧边栏已经转移到大型项目中可能完全不同的地方.

In Visual Studio Code, whenever I close a file, the next open file becomes active in the editor and the Side Bar moves to that file's location in the folder structure. This is usually not the behavior I want. I often want to open another file in the same location as the one I just closed, but now my Side Bar has shifted around to what could be a totally different place in a large project.

我喜欢主要 Visual Studio 产品的行为,其中解决方案不会自动移动.相反,如果我想查看文件在解决方案中的位置,我可以使用键盘快捷键移动到那里(在解决方案中查找文件"),而不是每次活动文件更改时自动移动到那里.

I like the behavior of the main Visual Studio product where the Solution does not automatically shift. Instead, if I want to see where in the solution a file is, I can use a keyboard shortcut to move there ("Find File in Solution"), instead of automatically moving there every time the active file changes.

有没有办法在 VSCode 中更改/禁用此功能?

Is there any way to change/disable this functionality in VSCode?

推荐答案

这是设置(用户或工作区)中的一个选项 explorer.autoReveal,它控制浏览器是否应自动显示打开文件时.

The is an option explorer.autoReveal in settings (either user or workspace) which controls if the explorer should automatically reveal files when opening them.

  1. 打开 VS 用户设置(首选项 > 用户设置).这将打开两个并排的文档.
  2. 向右侧的用户设置"文档添加新的 "explorer.autoReveal": false 设置(如果尚不存在).这样您就不会直接编辑默认设置,而是添加到其中.
  3. 保存用户设置文件.
  1. Open VS User Settings (Preferences > User Settings). This will open two side-by-side documents.
  2. Add a new "explorer.autoReveal": false setting to the User Settings document on the right if it's not already there. This is so you aren't editing the Default Setting directly, but instead adding to it.
  3. Save the User Settings file.

这篇关于如何阻止 VSCode 从侧边栏移动到当前文件所在的文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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