SoFunction
Updated on 2024-10-28

Sharing some lesser-known tricks in Pycharm

Pycharm is the most popular Python development tool, it provides very powerful features, it is one of the ideal tools to build large projects, if you can dig out the practical skills inside, can bring twice the result with half the effort.

The following actions are all based on the default KeyMap settings on Windows platforms, and are similar on Macs.

1. Quickly find files

Development projects, the number of files is getting huge, sometimes you have to switch back and forth between different files, if it is still from the left side of the project directory according to the hierarchy to find the words, the efficiency is very inefficient, usually we have to use the most recent viewed or edited files, with a quickCtrl + E You can open recently accessed files or use theCtrl+Shift+EOpen the most recently edited me file.

Scanning from the Tabs page one by one is not fast either, if you are OCD and don't want to show the Tabs page you can set Tabs to None in Settings and use the shortcut keys to open the recent files directly to improve efficiency.

2. Universal search

If you want to choose the most useful shortcut in Pycharm, it is Double Shift. Pressing Shitf twice in a row can search for filenames, class names, method names, and directory names. The trick to searching for a directory is to put a slash in front of the keyword./

If you want a global project-wide search for keywords inside a file, then you need to use theCtrl + Shfit + ForCtrl + Shfit + RGlobal Replacement.

3. Historical paste-ups

If you're a Mac user, you're familiar with Alfred, a history pasteboard utility that caches what you've copied in the past, which can be accessed in P Monthly Charm via theCtrl + Shift + V Access to the history pasteboard.

4. Split windows

In the large screen monitor to write code times cool, many times we switch back and forth in the two files, this time to cut the screen into two halves without having to switch back and forth, greatly improving the efficiency of the Pycharm's default configuration is not set up to split the shortcut key, you can customize the shortcut key in the Settings of the Keymap.

Supports not only vertical separation, but also horizontal separation

5. Smart Tips

Intelligent prompts are a standard feature of IDEs. Pycharm has an auto-prompt function by default, but it's not smart enough. For example, if you want to use a module that hasn't been introduced yet, you won't be able to be prompted automatically.Alt + Enter Smart prompts you to choose the right action.

6. Line breaks at any position

No matter where your cursor is, you can use the shortcut keyShfit + Enter Start a new line so that you don't have to move the cursor to the end to manipulate it.