Effective PyCharm Transcripts
Chapter: The Editor
Lecture: Syntax highlighting

Login or purchase this course to watch this video and the rest of the course contents.
0:00 One of the very first things you're sure to notice when you're working with PyCharm is it has great syntax highlighting.
0:07 Here's an example from one of the jumpstart examples that we were playing with earlier,
0:12 here's the game loop for that wizard app and notice we've got coloration for strings, for numbers, for key words like death and wild and true,
0:23 all sorts of stuff jump out with color to help us understand our code really,
0:28 really well. Of course it would be no surprise that this is highly customizable. First of off, there's a bunch of themes you can pick by default,
0:38 maybe you have the Mac Os light theme or you've got a Windows theme. Notice it can sync with the OS,
0:44 so like macOS will be light themed in the day and dark theme at night it can do that kind of stuff if you check that box,
0:51 but if you choose another theme, the one that I'm using this course is called darcula. The darker one on the left,
0:58 I just love the way that the lower contrast color is kind of let me sink into the code, It doesn't feel so bright and overwhelming.
1:05 But if you want a bright white, you can choose the Mac Os light or your Os light as well and get these
1:12 colors. So here's a coarse grained way to control what the syntax highlighting it looks like and the general colours overall.
1:20 But if you go into your settings, you can create your own themes.
1:24 Notice this one is called my darcula rather than dracula because I've changed how some
1:29 of the things look now, notice on the left there's color scheme and you can
1:34 change all the different languages. So here we've got version control colours, Python colours, angular template colors,
1:41 all kinds of things. And then once you go into a particular area like Python you can go and select different areas.
1:49 For example, class definition method calls keywords and so on and it shows you an
1:54 example of the bottom and what's not obvious but it's really awesome is you can click
1:58 those for example, if you click class it will automatically select keyword. If you click fu it'll reflect something like class definition,
2:07 click on the string, it'll go and highlight that and then let you control it And then on the right, see where it says foreground. It has F1EC33,
2:16 that yellow color. If you click the yellow color, a color wheel will come up and you can select it and customize it and see
2:22 it change live below. So really, really nice to be able to fine tune this.
2:27 One of the areas I find is if I'm doing like a conference presentation or something
2:31 and one of the colors, especially sometimes the purples and reds don't show up well
2:36 on the projector are over a cut down quality screen share and like on zoom or
2:41 something. So you can change just those things so they come through a little bit better and then once you get these all configured,
2:48 there's that gear in the top, right by where it says my darcula. If you click on that, you can export it and share it and save it
2:55 and so on. You can go from just taking the default to choosing a theme
2:59 to go in deep within and creating your own theme by tweaking an existing one like this.


Talk Python's Mastodon Michael Kennedy's Mastodon