VSCode file shortcuts I can't live without

Here’s a set of VSCode shortcuts that are part of my daily workflow for working with files!

We have seen a few VSCode shortcuts earlier, but none ever said -

I had enough of them shortcuts.

So, here goes.

1. Search text in all files

Search text in within all files in workspace using ..

Ctrl + Shift + F

vscode-shortcut-file-find

I used Explorer and Everything before incorporating this extension in my workflow. The biggest advantage is having to to search within the workspace folder - have all other files open in context of current work.

Of course, it helps immensely that you can also replace the searched text with something else. You can replace text by revealing the hidden field as depicted in the picture, or just do a Ctrl + Shift + H to directly open find/replace dialog.

2. Copy path of current file

Copy file path of the file currently being edited (while in editor).

Shift + Alt + C

Sometimes (and specifically on one of my machines) this does not work. And, I could not figure out why.

There are two quick ways to work-around -

  • Use alternative.

    Ctrl + K P
    

    Do not press P while still holding Ctrl.

  • Use command palette

    Ctrl + Shift + P > Start typing "copy path"
    
  • Go through file explorer

    Ctrl + Shift + E ... and then..
    Shift + Alt + C
    

Or, you could right click on tab of the file and copy the file path.

3. Reopen closed editor

I become anxious when too many editors are open - that is a direct indication of “not in control” mode. I tend to close editors quickly recklessly and the extension to reopen closed editor is quite handy.

Ctrl + Shift + T

vscode-shortcut-file-reopen-tab

4. Reveal current file in Explorer

There are just too many times I need to explore the folder of currently edited file. Use this shortcut to the parent folder in Explorer.

Ctrl + K R

vscode-shortcut-file-reveal-in-explorer

5. Close all open files

For all those times when you are frustrated and just want to close everything..

Ctrl + K W

You can always open tabs one by one by hitting Ctrl + Shift + T :). Handy when you have to show yourself how busy you are and make some noise with the keyboard.

Last updated:
Categories: Tools
Tags: apps
comments powered by Disqus