# Show & Tell: Idea / PyCharm Tips and Tricks ###### tags: `Show & Tell` --- ![Automation](https://imgs.xkcd.com/comics/automation.png) --- ### Look and Feel If you read a lot of code, a good font is vital: - 0 vs. O - l vs. I vs. | Must be monospaced - alignment is crucial. I prefer to use [Hack](https://github.com/source-foundry/Hack). ``` Editor > Font > Font: Hack Editor > Font > Size: 15 ``` --- ### CamelHumps navigation ``` Editor > General > Smart Keys > Use "CamelHumps" words: Enabled ``` Use `Ctrl+Left` and `Ctrl+Right` to jump between word parts. --- ### Workspace Hey, I got a terminal: ``` View > Tool Buttons: Enabled ``` Some flavors don't show the menu: ``` View > Toolbar: Enabled ``` --- ### Navigation Navigating code is not only about switching files: - Jump to a symbol definition - Jump to an error / line from traceback - History of locations in file ---- #### Disable Tabs Editor tabs might seem like a good idea, but... ``` Editor > General > Editor Tabs > Tab limit: 1 Editor > General > Editor Tabs > Placement: None ``` `Ctrl+Tab` is your friend. ---- #### Where am I? Navigate using project tree or jump to file / symbol ``` Autoscroll from Source: Enabled *(in project tree settings) ``` ---- #### Fast switching file ---- #### Use the history, Luke There is a history of locations in files you have jumpled to. It does not only track files, but also positions in a file. Use the arrow buttons or the back and forth buttons on your mouse. ---- #### Jump to a symbol Hit `Shift` twice. - Files, Functions, Structures - Fuzzy search - `MLC` -> MyLittleClass - `MyLiCla` -> MyLittleClass - `MyLittelClass` -> MyLittleClass - Context to current location ---- #### From symbol to symbol `Ctrl`-Click on usages to find definition `Ctrl`-Click on definition to find usages --- #### Markers and annoations Markers (in the editor on the right side) are clickable to jump to warnings and errors. Annotations (in the editor on the left side) show sub- and base-classes. --- ### Save some typing `Ctrl+Space` to complete stuff: - Symbols in code - Methods to override / implement - Boilerplate `Alt+Insert` to generate stuff: - Override methods --- ### Other keyboard shortcuts `Alt+Enter` fixes things. `Ctrl+Shift+/` toggles comments (multiple lines). `Ctrl+Alt+L` reformats your code (also works on selections). `Alt+Shift+R` renames a symbol. `Alt+Shift+L` generates a local variable from selection. `Alt+Shift+C` generates a constant from selection. `Alt+Shift+M` generates a method from selection. --- ### Project management Don't mix software projects in python projects. It will screw up your index. --- ### Bonus: Python environments A seperate (virtual) environment per project. Use `virtualenv` or `pipfile`. ``` Project: ${PROJECT_NAME} > Project Interpreter ``` --- ### More Bonus: Presentation Mode ``` View > Enable Presentation Mode ``` --- ![Brain](https://imgs.xkcd.com/comics/debugger.png)
{"slideOptions":{"transition":"fade","theme":"white"}}