visual-studio 在 Visual Studio 中打开解决方案中的文件的快捷键(热键)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1003445/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Key shortcut (hotkey) in Visual Studio to open a file inside your solution?
提问by dev.e.loper
Is there a key shortcut in Visual Studio to find & open a file inside your solution without using Resharper or any other tools?
Visual Studio 中是否有快捷键可以在不使用 Resharper 或任何其他工具的情况下在解决方案中查找和打开文件?
采纳答案by RichieHindle
Not a single keystroke, but yes: Ctrl+D > o f <space> filename(so that's five keystrokes before you start typing the filename). It then autocompletes the filename for you.
不是一次击键,而是:(Ctrl+D > o f <space> filename所以在您开始输入文件名之前是五次击键)。然后它会为您自动完成文件名。
You need the Find box in the toolbar for this to work.
您需要工具栏中的“查找”框才能使其工作。
(If you change your mind about addins, SonicFileFinderis for this very purpose, and free.)
(如果您改变了对插件的看法,SonicFileFinder正是为此目的,而且是免费的。)
回答by Just Shadow
The accepted solution doesn'twork in newer versions.
For Visual Studio 2017and 2019do the following:
接受的解决方案并没有在新版本。
对于Visual Studio 2017和2019,请执行以下操作:
Update 1:
Now pressing Ctrl+ Shift+ Tand typing file name works!
更新 1:
现在按Ctrl+ Shift+T并输入文件名有效!
Update 2:
For Visual Studio 2019 now it's possible to do similar search via Ctrl+ Q.
But it works slightly sloppysince it shows VS-related stuff as well.
更新 2:
对于 Visual Studio 2019,现在可以通过Ctrl+进行类似的搜索Q。
但它的工作有点马虎,因为它也显示了与 VS 相关的东西。
Original answer:
原答案:
- Press these keys to open "Go to" popup:
Ctrl+ , - Type there:
fSpaceFilename - Press Enter
- 按这些键打开“转到”弹出窗口:
Ctrl+ , - 在那里输入:
fSpace文件名 - 按 Enter
Notes:
注意事项:
- We are writing
fto make VS search only on files. We can also, use other letters. For more info type?in "Go to" popup. - For Visual Studio 2012to 2015take a look at thisanswer.
- 我们正在编写
f使 VS 仅搜索文件。我们也可以使用其他字母。有关更多信息,请?在“转到”弹出窗口中键入。 - 对于Visual Studio 2012到2015,请查看此答案。
回答by mellamokb
You can also use Ctrl+ /, which puts the >in place for you automatically.
您还可以使用Ctrl+ /,它>会自动为您放置到位。
回答by D.Kastier
Similar to Just Shadow's answer I discover that, on Visual Studio 2017, you can do the following:
与Just Shadow的回答类似,我发现在Visual Studio 2017 上,您可以执行以下操作:
Press Ctrl+ 1, then f
按Ctrl+ 1,然后f
Or you could go to Tools -> Options -> Keyboardand change the shortcut of Edit.GoToFilefor whatever you like.
或者你可以去Tools -> Options -> Keyboard改变Edit.GoToFile任何你喜欢的快捷方式。
I replaced mine with: Ctrl+ O
我用:Ctrl+替换了我的O
回答by Brent Sandstrom
Open the Command Palette: Click - View > Command Palette Type "File: Open File"
打开命令面板:单击 - 查看 > 命令面板键入“文件:打开文件”
VS Code will show you the hotkeys that are currently set when you do this. For me it's Ctrl + O
执行此操作时,VS Code 将向您显示当前设置的热键。对我来说是Ctrl + O


