Moving Through Your Code
Tips for moving through and navigating your code base
There are two screencasts on Navigation which you may also find useful:
Navigating Forward & Backward
Move forward and backward between your locations in the code
Use ⌘[ (macOS), Ctrl+Alt+Left Arrow (Windows/Linux) to navigate backwards and ⌘] (macOS), Ctrl+Alt+Right Arrow (Windows/Linux), to navigate forwards.
Use Find Usages to search for references in your code base
Press ⌥F7 (macOS), or Alt+F7 (Windows/Linux), to bring up the Find Usages tool window. You can search a single file, your whole project, or customise the scope.
You can also configure the color of the usages highlighting or disable the automatic highlighting of usages.
Go to Declaration or Implementation
Go to Declaration or Usages, or Go to Implementation
Go To Declaration or Usages (⌘B on macOS, or Ctrl+B on Windows/Linux) to see where code is declared or used. Go to Implementation (⌘⌥B on macOS, or Ctrl+Alt+B on Windows/Linux) can tell you where a method is implemented and take you there.
Navigate to Test
Go to your matching test class
Use ⇧⌘T (macOS), or Ctrl+Shift+T (Windows/Linux) to Navigate to Test and back again. IntelliJ IDEA will navigate to the related Test file, or suggest creating a test. It can even add some of the code constructs for the tests as well.
How to Quickly Jump to Recent Files in any JetBrains IDE
Are you tired of hunting for that crucial file buried in your project? Say goodbye to the hassle with these IDE shortcuts and tips. Jump to recent files effortlessly in JetBrains IDEs like IntelliJ IDEA, PyCharm, PhpStorm, WebStorm, GoLand, CLion, RubyMine, and more!
Have you ever been deep into a project, only to realize that you forgot to include something crucial in a file? We've all been there, so let's learn how to prevent this from happening to us again. While the tabs at the top of your screen are helpful, they can be a little bit overwhelming.
Instead of searching for a certain tab, let’s use our IDE. One convenient way to find certain files is using the Recent File Window. It gives you a nice list of all the files you have visited recently. It is automatically sorted in the order you have visited them, which makes going back so much easier
Well, that is already a great improvement, but we can do even better! What if the file you are looking for is at the very bottom. Well sure we could press arrow down like a hundred times, or worse use the mouse, or we just type directly into the window, which lets you search for a particular file.
Wouldn’t it be nice if you could narrow it to only the files you edited, not all you visited? In the upper right corner, you see the “Show edited only” files. This will help you remove some clutter and hides the files you just visited without doing any changes, and you can even open a certain file in a split window to have a look at multiple files at the same by clicking on the icon on the right side or pressing Shift or Enter.
I got one more for you, let’s check it out! If we look to the left side of our Recent Files Window we see all the amazing tools we recently used. You want to jump to the Terminal? Just type in “T-E-R” and it will take you right there.
Development is hard! and having a good overview of edited files is difficult. Luckily our IDEs make navigation really convenient!!
Recent Files & Locations
Quickly navigate around your recent files & locations
Press ⌘E (macOS), or Ctrl+E (Windows/Linux), to navigate around the files that you've opened recently.
Press ⇧⌘E (macOS), or Shift+Ctrl+E (Windows/Linux), to view your recent locations.
You can filter the recent locations list to files that you've changed by using the same shortcut again.
Go to Next Error
Quickly move to the next (or previous) error or warning in the file.
When you open a source file in the editor, you may see warnings or errors in this file. You can quickly step through to check all these issues without having to use the mouse, just press F2.
While you're coding, you may want to jump to the next error or warning (F2) or the last one (Shift+F2). This way, you can quickly hop to the next thing that needs fixing or addressing without having to move your hand to the mouse.
Combine this with ⌥⏎ (macOS), or Alt+Enter (Windows/Linux) to quickly see the suggested solution to the problem and apply a fix. This will show a list of suggested solutions, as we saw in the tip about Context Actions, and we can pick the solution that suits us best.
If you're confident IntelliJ IDEA has the correct fix for the problem, you can skip the step of listing the solutions. Press F2 to navigate to the problem, then press ⌥⇧⏎ (macOS), or Shift+Alt+Enter (Windows/Linux), to accept IntelliJ IDEA's suggested fix.