Key shortcut (hotkey) in Visual Studio to open a file inside your solution?

时光毁灭记忆、已成空白 提交于 2019-12-03 10:40:51

问题


Is there a key shortcut in Visual Studio to find & open a file inside your solution without using Resharper or any other tools?


回答1:


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.

You need the Find box in the toolbar for this to work.

(If you change your mind about addins, SonicFileFinder is for this very purpose, and free.)




回答2:


The accepted solution doesn't work in newer versions.
For Visual Studio 2017 and 2019 do the following:

Update 1:
Now pressing Ctrl + Shift + T and typing file name works!

Update 2:
For Visual Studio 2019 now it's possible to do similar search via Ctrl + Q.
But it works slightly sloppy since it shows VS-related stuff as well.

Original answer:

  1. Press these keys to open "Go to" popup:
    Ctrl + ,
  2. Type there:
    f Space Filename
  3. Press Enter

Notes:

  • We are writing f to make VS search only on files. We can also, use other letters. For more info type ? in "Go to" popup.
  • For Visual Studio 2012 to 2015 take a look at this answer.



回答3:


You can also use Ctrl + /, which puts the > in place for you automatically.




回答4:


Similar to Just Shadow's answer I discover that, on Visual Studio 2017, you can do the following:

Press Ctrl + 1, then f

Or you could go to Tools -> Options -> Keyboard and change the shortcut of Edit.GoToFile for whatever you like.


I replaced mine with: Ctrl + O




回答5:


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



来源:https://stackoverflow.com/questions/1003445/key-shortcut-hotkey-in-visual-studio-to-open-a-file-inside-your-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!