Issue #19 (Useful Keyboard Shortcuts)08/31/22
|
Get a weekly dose of tools, articles, and other resources covering remote work, productivity, career well-being, and lots more.
|
|
|
There are a number of different keyboard shortcuts that are good to know when navigating files and file contents in VS Code. And naturally, many of these same shortcuts are used in other IDEs and editors too. I'm sure many of you more experienced VS Code users will be familiar with most of these, but for those just getting started, maybe this will help you navigate your files and folders faster.
You might commonly use the explorer view with your mouse to select a particular file in the currently open project. But in some cases, especially if files are inside multiple nested folders,
it's easier to use CTRL-P, which opens the "Go to File..." box (similar to the command palette, but without the ">" in the box).
From there, you can start typing the name of the file you want to access and VS Code will show you a list that also includes recently opened files (which appear by default even before you start searching).
You can also conduct a
symbol search inside a file by hitting CTRL-SHIFT-O. This opens the "Go to Symbol in Editor..." box. This time the @ character in the box indicates that you're doing a symbol search. Here you can search for functions, objects, variables, etc., within the current file.
You can start typing the name of the function or other object to take you directly to that part of the file.
Similar to navigating multiple tabs in a browser, you
can easily switch between currently open files by using CTRL-TAB. This opens a rotating file view where you can cycle through and choose the file you want to focus on.
This can help when you have multiple files open.
Similarly, you can use ALT-LEFT and ALT-RIGHT (or OPT-LEFT/RIGHT on Mac) to navigate directly to the next file over without opening the list of currently open files.
Now on to this week's hand-picked links!