gpt4 book ai didi

visual-studio-code - Visual Studio 代码 - 如何复制搜索结果?

转载 作者:行者123 更新时间:2023-12-03 09:13:22 26 4
gpt4 key购买 nike

Visual Studio Code 有没有办法将搜索结果复制到新窗口中?

作为奖励,我真的很希望能够删除文件名,只需将包含搜索结果文本的行复制到新窗口。

例如,我希望能够将下面的搜索结果复制到一个新的编辑器窗口。我不介意我是否需要安装一个扩展来做到这一点。

enter image description here

最佳答案

VSCode 1.23 添加了复制搜索结果的功能,请参阅 release notes: copy search results .

The search results tree context menu includes three new options: Copy, Copy Path, and Copy All. This was a highly 👍'd request which will make it easier to share or export your search results.



复制/粘贴时结果不是很漂亮或可点击,因此请预先警告。跟踪“复制搜索结果”格式(请参阅 https://github.com/microsoft/vscode/issues/68877 )存在一个问题,它位于 2019 年路线图(请参阅 https://github.com/Microsoft/vscode/wiki/Roadmap#workbench )中,因此希望它会得到改进。

更新自 v1.41 您可以将搜索结果移动到一个新的编辑器,然后轻松地全选并复制到那里。演示:

search results copy in a new editor

搜索编辑器的另一个优点是您可以在搜索结果周围获得“ 上下文 ”。因此,您可以在包含搜索词的整行之前和之后获得一些行。当然,行号也会被复制。

search editor context demo

您只需 保存 Ctrl+S 搜索结果编辑器本身!并从那里剪下线条。或者添加注释。带有语法高亮。它会询问您要将其保存在哪里,默认为您启动搜索的文件夹。它将命名为 yourFolder\yourSearchTerm.code-search .

有关新搜索编辑器的更多信息,请参阅 https://code.visualstudio.com/updates/v1_43#_search-editors

关于visual-studio-code - Visual Studio 代码 - 如何复制搜索结果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41961368/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com