Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MASTERING PYCHARM

You're reading from   MASTERING PYCHARM Use PyCharm with fluid efficiency to write idiomatic python code

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781783551316
Length 232 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Nafiul Islam Nafiul Islam
Author Profile Icon Nafiul Islam
Nafiul Islam
Arrow right icon
View More author details
Toc

The basics

The first time you install PyCharm, the theme will default to IntelliJ. But, if you prefer something darker, I suggest you use Darcula. I personally prefer a darker IDE, so I go with a custom version of Darcula that's tailored to my tastes.

The basics

However, let's start with the default UI and see how we can make PyCharm look a little better.

The first change – fonts

The first thing that hit me when I opened up PyCharm was the hideous font set by default to be Courier New. Let's change this:

The first change – fonts

With the color scheme set to Default, you will need to save your new color scheme with a different name before you can go about making any changes to the scheme. You can just click on Save As... and then simply enter the name of your scheme in the popup. After doing so, you are free to make any changes you wish.

The first change – fonts

The Show only monospaced fonts option is enabled by default, but you can change it to include other fonts such as Arial or Times New Roman as well. Also the choice of a secondary font is important when you're trying to import your settings to another computer that does not have your desired font.

A typical example would be Consolas; it's only available on Windows machines, so when you try to import your font settings to Ubuntu or Mac, you likely get the default monospaced font. I usually set my default font to Consolas and my secondary font to Ubuntu Mono since it's free and can be made available on all the machines.

Now that the font business is taken care of, let's get down to a couple of other features. We will revisit this part of PyCharm pretty soon.

The layout

The layout

The default PyCharm layout is quite minimal. With reference to the preceding screenshot, you get an editor in [1], and the list of your directories and files in [2]. Actually, [2] is a sidebar, so if you click on [3], you get a totally different sidebar popping up.

You can show/hide it using Alt + number indicated by the underline. So, in this case, if you were to press Alt + 7, the panel indicated by [3] (Structure) would show up. Once you're familiar with the layout, you can hide all the panel buttons by clicking on [4].

The minimalist

The minimalist

If you'd like to focus completely on the code, you ideally want a minimalistic layout without all the extra tools taking up your screen. Let's see how PyCharm can help us with this.

The minimalist

So far, we can hide panels; now let's get rid of all the other distractions as well. The area highlighted with the arrow in the preceding screenshot is called the navigation bar; if you'd like to get rid of it, you can deselect the Navigation Bar option in the View option menu.

Note that with the Navigation Bar option, you also lose the Run, Debug, Coverage, and Search Anywhere buttons; but don't worry, there are plenty of shortcuts available so that you can do everything you want from your keyboard.

You can make the navigation bar appear as a popup instead of being a permanent bar by pressing Alt + Home (if this is not your shortcut, search for navigation bar in the Keymap):

The minimalist

As for the Debug and other buttons that we got rid of, you can always get them through Find Action, Ctrl + Shift + A.

The minimalist

Search Everywhere searches files, actions, classes, objects, and pretty much everything using double Shift (pressing Shift twice in quick succession):

The minimalist

PyCharm can also go to full screen mode (it even gives you a nice helpful clock in the top right):

The minimalist

I never use this mode because with my start menu minimized, with no navigation bar, and a collapsible Project sidebar, I have plenty of screen space to get the job done.

Another tool that I really appreciate is Switcher, which can be invoked with Ctrl + Tab. It appears as a floating window:

The minimalist

You can quickly navigate through your open files on the right-hand side of the window, and on the left-hand side you have some commonly used tools. You can navigate by pressing Tab again, and this will proceed through the list. You can also use the arrow keys. However, note that you will need to keep the Ctrl key pressed down as long as you're using Switcher.

You can quickly get to them by pressing the key underlined. In this case, you can quickly get to Terminal through first pressing Ctrl + Tab to bring up Switcher; if, while holding down the Ctrl key, you press 4, (in the preceding screenshot, Terminal is 4, but you might get a different number), you can open up Terminal.

You can close anything, that is, a tool panel or an editor tab using Ctrl + F4.

You have been reading a chapter from
MASTERING PYCHARM
Published in: Oct 2015
Publisher:
ISBN-13: 9781783551316
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime