Eric J Ma's Website

VSCode Tip: Cmd+P lets you switch to any file within a repository

written by Eric J. Ma on 2023-10-08 | tags: vscode tips and tricks til navigation repository productivity


Sharing a quick tip here when using VSCode.

I have noticed colleagues sometimes struggle to locate an exact file that they want to open when using VSCode. As it turns out, the Command Palette gives us a quick way of navigating to any file within a repository.

The trick here is to do a Cmd+P, which will open up the command palette in file-browsing mode. From there, you can start typing keywords to quickly narrow down the exact file that you want to open. Any portion of the file path is fair game!

It looks something like this (you can click on the image to zoom in):


Cite this blog post:
@article{
    ericmjl-2023-vscode-repository,
    author = {Eric J. Ma},
    title = {VSCode Tip: Cmd+P lets you switch to any file within a repository},
    year = {2023},
    month = {10},
    day = {08},
    howpublished = {\url{https://ericmjl.github.io}},
    journal = {Eric J. Ma's Blog},
    url = {https://ericmjl.github.io/blog/2023/10/8/vscode-tip-cmdp-lets-you-switch-to-any-file-within-a-repository},
}
  

I send out a newsletter with tips and tools for data scientists. Come check it out at Substack.

If you would like to sponsor the coffee that goes into making my posts, please consider GitHub Sponsors!

Finally, I do free 30-minute GenAI strategy calls for teams that are looking to leverage GenAI for maximum impact. Consider booking a call on Calendly if you're interested!