IntelliJ/PyCharm performance and beauty tips
This post contains some productivity, performance and code beautifying tips. They are based mainly on my personal experience with both IntelliJ and PyCharm. Never thought I would get myself paying attention on such tips but now I feel much more productive when coding in IntelliJ/PyCharm.
In this post:
- Color Scheme and Theme in IntelliJ/PyCharm
- IntelliJ change main theme/color scheme
- IntelliJ install new themes/color schemes
- Open multiple projects and windows
- Open two projects
- Open multiple windows
- Compare File
- Selection
- Syntax aware selection
- Block and multiple selection
- Comments
- single line
- multi line comment
- Useful plugins
- CodeGlance
- Presentation Assistant
- Search and Find
- Productivity guide
Color Scheme and Theme in IntelliJ/PyCharm
IntelliJ change main theme/color scheme
Jetbrains products like IntelliJ has 3 themes by Default:
- IntelliJ - light theme
- Darcula - dark theme
- Windows / GTK+ - which is theme close to your OS view
You can choose the theme at the first start of the program or change it later from:
IntelliJ change main theme
- Settings
- Appearance & Behaviour
- Appearance
Change Color Scheme
- Settings
- Appearance & Behaviour
- Editor
- Color Scheme
IntelliJ install new themes/color schemes
One of the way for adding new themes is by using plugins. Popular plugin for adding themes and color schemes is: Install Material Theme UI. You can add it by:
Install Material Theme UI
- Settings
- Plugins
- Browse Repositories
- Material Theme UI
- Install
Install themes from color-themes.com
- visit site IDEA, Webstorm, PyCharm, RubyMine, PhpStorm and AppCode Color Themes
- Select theme (or download all of them)
- download .jar file
- import it by
- File
- Import Settings
- select the .jar file
- import
Open multiple projects and windows
Open two projects
You can work with several project at once in IntelliJ. The difference with Eclipse is that you are using different container for each project. Another point is that search and find are working only in the current project - this is better than eclipse way of opening all projects in a single window. if you want to open more than one project:
- File
- Open Recent
- New Window
Open multiple windows
You can open a code file in a separate window, then move it to another monitor and work with several windows simultaneously. This is extremely helpful if you want to rewrite or use file as a reference. This can be cone by:
SHIFT+ENTER
Compare
If you want to compare two files in PyCharm for example. You can select them in the project view and then to type:
CTRL+D
No tabs
This feature could be really confusing and even anti productive initially. But after some time spent with it you will find that is a lot easier and faster to work with several files without need for scrolling and searching tabs. If you want to remove tabs in your IntelliJ you can do it by:
- Settings
- Editor
- General
- Editor Tabs
Useful plugins
CodeGlance
If you have experience with Sublime you most probably know about the minimap. This is a nice feature which is showing current file in small size window. You can use it as scrollbar and change your current position in a file. You can achieve similar feature in IntelliJ by using pluing named CodeGlance
Install code glance plugin (code minimap)
- Settings
- Plugins
- Browse Repositories
- CodeGlance
Presentation Assistant
Simple and nice tool for presentation. Showing information about the action and the short cut used. This plugin can be installed by:
Install code glance plugin (code minimap)
- Settings
- Plugins
- Browse Repositories
- Presentation Assistant
You can customize it via: Settings | Appearance & Behavior | Presentation Assistant
Search and Find
Search, find and replace are essential operation for every programmer. They are very extremely useful and increasing your performance many times. Here you can find several ways to search, find and replace:
- search everywhere - double SHIFT - this will search the entire project. You can use this to find files from a given type - for example getting all XML files - *.xml
- recent files - CTRL+SHIFT+E - This is a view of all recently modified items. It can be used if you stop using tabs.
- search class - CTRL+N - this will search for classes.
- search file - CTRL+SHIFT+N - This one is searching for any file which is matching your constraints
- Find in file - CTRL+F - search only in current file
- Replace in file - CTRL+R - if you want to replace something in the current file scope.
Selection
Syntax aware selection
You can select code based on the code syntax. This can be done very easily with extended selection. The commands for extended selection in IntelliJ / PyCharm are:
extend:
CTRL+W
decrease:
CTRL+SHIFT+W
Block and multiple selection
Block selection is very useful feature for every text editor or IDE. List modern IntelliJ / PyCharm IDEs can perform block selection by:
Windows(Pure block selection):
- Press and hold: ALT
- Select with left mouse button
- Now you can copy, paste or delet
Windows(multiple selection):
- Press and hold: ALT
- Press SHIFT
- Click left mouse button to select(this adds many cursors)
- Do something
Windows(select code lines end):
- Go on the most right position of your code
- Click left mouse button to select
- Move up or down(this will add cursor to the end of each line)
- Do something
Comments
You can comment code blocks in IntelliJ/PyCharm by using single or multiline comments. They are availble for many languages like Java, Python, HTML etc. These are the shortcuts for single and multiline comments:
- Single line comment(Python
#
; Java//
; HTML<!-- -->
)
comment:
CTRL+/
uncomment:
CTRL+/
- Multiline comment(Java comment -
/* */
, ; HTML<!-- -->
)
comment:
CTRL+SHIFT+/
uncomment:
CTRL+SHIFT+/
Productivity guide
This is very interesting feature which shows productivity tips, how often you are using them and the last time when they were used. You can find also information about the tip and what is doing:
-
Feature - Comment/Uncomment block
-
Group - Code Assistants
-
Used - 50 times
-
Last used 17 minutes ago
-
Description:
You can comment or uncomment lines and blocks of code using Ctrl+/ and Ctrl+Shift+/.
Ctrl+/ comments or uncomments the current line or selected block with single line comments (//...).
Ctrl+Shift+/ encloses the selected block in a block comment (/.../).
To uncomment a commented block press Ctrl+Shift+/ anywhere inside it.
You can find there also funny information like:
IntelliJ uptime: 47 minutes, idle time 38 minutes
Code completion has saved you from typing at least 1.6K characters since 5/12/2017( ~21 per working day)
Quick fixes has saved you from 11 possible bugs since 5/19/2017(~1 per working day)