This is a repost from the Software Mastery newsletter. If you like what you see, consider subscribing to get emails delivered right to your inbox!
Welcome to the second issue of the Software Mastery newsletter.
In this issue, I want to share three shortcuts you should be aware of when navigating large codebases as a software engineer:
Whether you're new to a codebase or an expert, these shortcuts will make you more productive at finding what you’re looking for.
Since I primarily use IntelliJ, my examples will be for this IDE. However, all the mentioned shortcuts should also be available in other IDEs.
Sometimes, we know the name of the file we want to find, but we either don’t remember which folder it is in or don’t want to expand a bunch of folders in an IDE’s file explorer to get to it.
In these cases, it’s useful to know how to search for a file by name. In IntelliJ, one way to do this is Ctrl Shift N, which opens the search everywhere window on the "Files" tab.
In this window, you can type the name of the file you want to open. For Java and other object-oriented programming languages, you’ll want to type the name of a class here (e.g., MyAwesomeClass).
Bonus tip: The search anywhere feature employs a kind of fuzzy search, so for a class like MyAwesomeClass, you can get away with typing the first letter of each word:
Searching for a string in a codebase is useful for various reasons:
In IntelliJ, you can search for a string with Ctrl Shift F, which opens the find in files window.
Finally, the last shortcut I want to share is actually a pair.
When working in an unfamiliar codebase, you often need to read code written by other people, which invokes more code written by other people, and so on.
For your sanity, you’ll want to know how to jump to the declaration of a class, method, or field and how to go back to where you were before.
In IntelliJ, you can jump to declaration with Ctrl B. To go back, one option is Ctrl Alt Left Arrow.
I hope this week’s issue convinced you to use these three IDE shortcuts in your day-to-day work.
Are there any other shortcuts you can’t live without? Reply to this email or comment below to let me know!
Thanks for reading!
Sammy
The above is the detailed content of ⌨ DE Shortcuts I Use Daily. For more information, please follow other related articles on the PHP Chinese website!