gpt4 book ai didi

visual-studio - Visual Studio : Is there a way to Perform a "Find in files" with one single shortcut?

转载 作者:行者123 更新时间:2023-12-04 17:04:52 28 4
gpt4 key购买 nike

我想在代码中选择一个表达式并输入 Ctrl+Whatever
所以它的结果与 [ Ctrl+Shift+F AND Clicking on "Find All"] 相同

编辑:[Ctrl+Shift+F 并按 Enter] 可能比单击更快,但我仍然想要更具体和更快的东西

备注:我对 Find All References 快捷方式不感兴趣。

最佳答案

你可以用宏。我在VS2010中记录并修改了一个:

Sub FindAllFiles()
DTE.Find.FindWhat = DTE.ActiveDocument.Selection.ToString()
DTE.Find.Target = vsFindTarget.vsFindTargetFiles
DTE.Find.MatchCase = False
DTE.Find.MatchWholeWord = False
DTE.Find.MatchInHiddenText = True
DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral
DTE.Find.SearchPath = "Entire Solution"
DTE.Find.SearchSubfolders = True
DTE.Find.FilesOfType = ""
DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResults1
DTE.Find.Action = vsFindAction.vsFindActionFindAll
If (DTE.Find.Execute() = vsFindResult.vsFindResultNotFound) Then
Throw New System.Exception("vsFindResultNotFound")
End If
End Sub

宏可以设置为键盘快捷键。见: http://msdn.microsoft.com/en-us/library/a0003t62(v=vs.80).aspx

关于visual-studio - Visual Studio : Is there a way to Perform a "Find in files" with one single shortcut?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4980885/

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