最近更改了VSCODE的位置(例如在Intellij中)
我喜欢功能 fersitation Intellij 的。
出于其他原因,我将使用Vscode(对于Golang)。
VSCODE中是否有类似的功能?
我想查看我最近位置的列表(可选过滤,以便只能看到该位置,最近更改了)。
休息后(如午餐),此功能真的很方便。它可以帮助您在休息前连接到工作。
尤其是“仅改变的演出”非常有帮助。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
如果您使用git,则可以在此处获得大部分请求。 VSCODE在侧边栏中具有GIT扩展名,显示您已更改了哪些文件,如未分段和上演的更改。
您也可以使用
alt+左/右
箭头之间的位置跳跃。这是独立于git。它只是记住您的最后一个光标位置。如果您愿意使用一个扩展程序,则似乎有一个可以按照您的要求做的,以其名称来判断: https://marketplace.visualstudio.com/items?itemname = percygrunwald.vscode-intellij-recent-recent-files
If you use git, you get most of what you request here. Vscode has a git extension in the sidebar that shows you what files you have changed, as in unstaged and staged changes.
You can also jump between location, with
alt+left/right
arrow. This is independent from git. It just remembers your last cursor positions.If you are willing to use an extension, there is one that seems to do what you are asking for, judging by its name: https://marketplace.visualstudio.com/items?itemName=percygrunwald.vscode-intellij-recent-files
此函数称为“导航返回”,您也可以在 Visual Studio Code的关键绑定< /a>,从钥匙界UI中的VSCODE中更容易访问。
This function is called "navigate Back", you find it also in the Key Bindings for Visual Studio Code and more accessible within vscode from the keybindings UI.
@geettli是不同的编辑,因此很难始终找到完全相同的功能。我认为至少在写这篇文章时,没有什么比最近的位置更像Vscode的位置了。将来会有类似的东西吗?大概。
CTRL-P将显示最近打开的文件的列表,并通过选择一个文件之一,在编辑文件时将转到最后一个位置。要查看文件中的更改(w/ git),您可以右键单击它并选择“查看时间表”或使用git按钮查看更改。不完全是您要求的,但可能有用。
@guettli They are different editors, so it will be hard to always find the exact same feature. I think there is nothing like recent locations in vsCode, at least when i'm writing this. Will there be something like that in the future? Probably.
Ctrl-P will display a list of recently opened files, and by selecting one of the files it will go to the last location when editing the file. To see the changes in a file(w/ git) you can right-click it and select the "view timeline" or view the changes with the git button. Not exactly what you asked for but may be useful.
Ctrl+P将在VSCODE中显示最近打开的文件的列表
您可以在VSCODE的右下角使用时间表选项,以比较当前打开的文件的先前文件和当前更改
您甚至可以将文件与右键单击文件进行比较
您可以在此视频中获得有关代码导航的更多信息 https://www.youtube.com/watch?v=muqmmsipi04
Ctrl+P will display a list of recently opened files in Vscode

You can use Timeline option at the right-bottom corner of the vscode for comparing previous file and current changes of the file that is in currently opened
You can even compare the files with options on right clicking the file

You can get more about code navigations in this video https://www.youtube.com/watch?v=MuQmMsIpI04
我正在使用 gitlens伸展+shift+g g“ 命令
workbench.view.scm
快速查看自上次提交以来修改的文件并在其中浏览。I am using the Gitlens extension and I use the shortcut

"ctrl+shift+g g"
for the commandworkbench.view.scm
to quickly see the files modified since the last commit and navigate among them.在撰写本文时,VS代码本身没有这样的功能来显示更改的列表。它确实会跟踪撤消堆栈和工作空间会话中的更改,因此只需要在该模型 /信息中添加接口即可。
我认为扩展程序也可以通过使用
ondidchangenotebookDocument
和ondidchangeTextDocument
” /vscode-api#workspace“ rel =“ nofollow noreferrer”>workspace
对象。对于自定义编辑器,在自定义编辑器提供商上还有ondidchangecustomDocument
事件。扩展名只会跟踪这些事件并显示它们。仅供参考,此前已被要求,例如最近编辑的编辑器#42880 (以bot为单位的“不在范围”)。
解决方案
有命令可以在编辑位置之间来回导航,您可以将其绑定到键盘快捷键或从命令调色板运行:
workbench.action.navigatebackatigebackedItiTlocations
and code> workbench.action.action.navigate.navigateforforwardinedItItlocations 。有一种方法可以通过使用时间轴视图功能以每文件的方式查看最新更改(顺序),尽管其工作方式不同。与以个人变化为导向的更具快照为导向。它将显示本地历史功能和SCM提交的条目。对于本地历史记录 entries entries snapshots workbench.localhistory.mergewindow 设置以及
files.autosave
和files.autosavedelay
。您可以更改各种排序的事情:
在最近使用的编辑器之间也有各种命令可以打开或导航,您可以绑定到keyboard shortcuts:
workbench.action.quickOpenLeastRecentlyUsedEditor
,workbench.action.quickOpenLeastRecentlyUsedEditorInGroup
,workbench.action.quickOpenPreviousRecentlyUsedEditor
,workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup
,workbench.action.openNextRecentlyUsedEditor
,workbench.action.openNextRecentlyUsedEditorInGroup
,workbench.action.openPreviousRecentlyUsedEditor
,workbench.action.openpreviousReclySeditoringRoup
。这些非常接近您想要的东西,但属于文件的粒度,而不是个人更改。如果您不在乎进行更改的顺序,并且可以通过SCM COMMIT查看更改,则源控制视图具有多-DIFF功能(请参阅我对
At the time of this writing, VS Code itself doesn't have such a feature to show a listing of changes. It does keep track of the undo stack and changes in the workspace session, so it would only need to add an interface to that model / information.
I think an extension could also implement this by using the
onDidChangeNotebookDocument
andonDidChangeTextDocument
event listeners on theworkspace
object. For custom editors, there is also theonDidChangeCustomDocument
event on the custom editor provider. The extension would just track those events and display them.FYI, this has been requested before, such as in Have a history for recently edited editors #42880 (closed as "out of scope" by bot).
Workarounds
There are commands to navigate back and forth between edit locations, which you can bind to keyboard shortcuts or run from the command palette:
workbench.action.navigateBackInEditLocations
andworkbench.action.navigateForwardInEditLocations
.There is a way to view recent changes (in order) on a per-file basis by using the Timeline View feature, though the way it works is different. It's more snapshot oriented than individual-change-oriented. It'll show entries from the Local History feature and SCM commits. For the local history entries (snapshots from saving the file/editor), you may want to change the
workbench.localHistory.mergeWindow
setting and maybefiles.autoSave
andfiles.autoSaveDelay
.You can change various sort order things:
There are also various commands for opening or navigating between recently used editors which you can bind to keyboard shortcuts:
workbench.action.quickOpenLeastRecentlyUsedEditor
,workbench.action.quickOpenLeastRecentlyUsedEditorInGroup
,workbench.action.quickOpenPreviousRecentlyUsedEditor
,workbench.action.quickOpenPreviousRecentlyUsedEditorInGroup
,workbench.action.openNextRecentlyUsedEditor
,workbench.action.openNextRecentlyUsedEditorInGroup
,workbench.action.openPreviousRecentlyUsedEditor
,workbench.action.openPreviousRecentlyUsedEditorInGroup
. These are kind of close to what you want but are in granularity of files, and not of individual changes.If you don't care about the order in which the changes were made, and are okay with viewing changes by SCM commit, the Source Control View has a multi-diff feature (see my answer to In VS Code, how can I view a list of files with staged/unstaged changes, where clicking an entry opens a comparison/diff view?).
我想您可以使用vim标记(使用 vim仿真扩展)基本上是相同的想法,但不是真正的自动。
如果您在GIT存储库中工作,VSCODE将在Git选项卡中显示您上演和未分段的更改,并且还将向您显示差异。
实际上,它们是不同的编辑,默认功能不会映射1∶1。
tl; dr:不,不是真的,或者至少不是本地
I suppose you could use Vim marks (with the vim emulation extension), which is basically the same idea, but it's not really automatic.
If you're working in a git repository, VSCode will show you staged and unstaged changes in the git tab, and will also show you the diffs.
It really comes down to the fact that they're different editors and default functionalities will not map 1∶1.
tl;dr: no, not really, or at least not natively