Know Your Tools: JetBrains IDE
Tags: python, programming, tutorial
Published: 2024-07-06 13:40:40

Throughout my career as a Product Manager, I’ve developed key principles. One of them is "Know Your Tools." This concept is inspired by [The Pragmatic Programmer](https://www.amazon.co.uk/Pragmatic-Programmer-Andrew-Hunt/dp/020161622X). “Tools amplify your talent. The better your tools, and the better you know how to use them, the more productive you can be”. For me, this means taking the time to thoroughly learn the tools you use every day.

Two years ago, I started learning Python (read more about [Technical Skills for Product Manager](https://dev.to/zerocodilla/technical-skills-for-product-manager-1m1p)). I soon realized the depth of the rabbit hole, and solving problems in Python quickly became my hobby. For my coding journey, I have used [PyCharm](https://www.jetbrains.com/pycharm/) and invested my time in mastering it. In this article, I invite you to discover simple yet powerful JetBrains IDE features that are accessible at any proficiency level and inspire you to explore further.

## Learning Tools
First of all, I highly recommend the onboarding tour to everyone using JetBrains' IntelliJ-based IDEs (Help -> Learn IDE Features). It's an absolute masterpiece and a truly enjoyable process. In my opinion, it sets the standard for what a learning guide should be. 
However, people may hesitate to follow learning guides, finding it challenging to remember new features, which may not match their proficiency level or might simply be boring. That's why I prefer focusing on 4-6 features, mastering them, and then progressing to the next set.

## Search Everywhere
Press ⇧ (macOS) / Shift (Windows/Linux) twice to open Search Everywhere. Suppose you are looking for the file password_generation.py. Type “pg” as the initial letters of these words and see the results. 
![Search Everywhere Feature Demonstration](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqw0e6sz4hpwpdc6m23t.png)
You can type any words or letters you think might be part of your file, and it will work. This feature is colloquially referred to as [Fuzzy Search](https://en.wikipedia.org/wiki/Approximate_string_matching). The same technology is available in the Find Action ⇧⌘A (macOS) / Ctrl+Shift+A (Windows/Linux).

## Restore Removed Code
If you removed some code fragments and made several valuable changes, the usual “undo” is not a suitable solution. But restoring code from history works perfectly. Right-click anywhere in the editor to open the context menu, and go to Local History -> Show History. Find the code fragment you need to restore and click the button >>
![Code Fragments in the Local History Window](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/suxdv2lk989b09f332a5.png)

## Code Selection
In addition to the usual ⇧+Arrows (macOS) / Shift+Arrows (Windows/Linux), you can try the ⌥+Arrows (macOS) / Ctrl+Shift+Arrow (Windows/Linux) combination. Press ⌥+Up Arrow (macOS) / Ctrl+Shift+Up Arrow (Windows/Linux) to select the word, once again to select the whole string, and once again to include quotes in the selection.
![Code Selection Example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jzqi3afm3tf6d9qt69t9.png)
Press ⌥+Down Arrow (macOS) / Ctrl+Shift+Down Arrow (Windows/Linux) to shrink the selection. If you move the caret to the beginning of code blocks, this action will select this segment.

## Move Code
Press ⌘⇧+Up/Down Arrows (macOS) /  Shift+Alt+Up/Down Arrows (Windows/Linux) to move code fragments. For moving methods, the caret should be at the header of the method. Another shortcut ⌘+Del (macOS) / Ctrl+Y (Windows/Linux) is useful to remove lines.

## Syntax Quick-Fixes
JetBrains IDEs are a perfectionist's dream… and nightmare. They won't let you sleep until every warning is fixed. Thankfully, you can simply press ⌥+Return (macOS) / Alt+Enter  (Windows/Linux) to reformat your file and turn imperfect code into polished perfection.
![Example of Syntax Quick-Fixes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ca872tu0jzj8jo6b94y4.png)
Another useful feature is removing redundant parameters from all the code. It’s really beautiful how this feature optimizes your code if needed.
![Quick Remove of Redundant Parameter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5m2lknq6dpzu0xvovdf6.png)
You also can remove redundant imports.
![Optimize Imports](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/14y10h6z38i4qtb2x5kn.png)

## Automatic F-string Completion
If you have a simple Python string but want to convert it to an f-string, just start typing {whatever… select the suggested parameter, and the string will be transformed into an f-string automatically.

## Rename Refactoring
If you need to rename some variables in the files, the Rename Refactoring feature is your time saver. Press ⇧F6 (macOS) / Shift+F6 (Windows/Linux) to rename.
![Rename Feature](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6ueqvpyfrv6aj9ou0ap.png)
All usages of this parameter will be renamed automatically.
![Code after Rename Refactoring](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ymisb6q5c2ekb4x4xsdk.png)
In difficult cases with many usages, you will be advised to choose files for refactoring.

## Explore Further
I use PyCharm Community Edition for my coding practice. However, PyCharm Professional offers support for many Python frameworks, has integrated DB tools, an HTTP client, and more. So, if you are working on a complex web-based commercial project, PyCharm Professional could be a more suitable tool. The AI Assistant also looks very intriguing and is next on my list to explore.

## Conclusion
We can't harness the full power of our brains, but we can maximize our use of JetBrains tools. Don't settle for a basic level of proficiency. Mastering tools can significantly boost your productivity and inspire you to bring new features into the products you create.