PyCharm Flashcards

1
Q

Effective PyCharm 9 topics

A
  1. Projects
  2. Editor
  3. Git
  4. Refactoring
  5. Databases
  6. Debugging
  7. Profiling
  8. Testing
  9. Packaging
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Projects: 4 kinds of roots

A
  1. Source roots: for resolving imports
  2. Resource roots: images, style sheets
  3. Excluded: ignored by PyCharm
  4. Template folder: templates
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Projects: Add installed package to requirements.txt

A

Right click on the import > Add imported packages to requirements.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Projects: search everywhere

A

Double Shift:
1. Search classes
2. IDE actions
3. files
4. Git

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Projects: search show_leaderboard()

A

Double shift > s_l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Editor: create a function in module by simply calling the function

A

alt+enter

mymodule.new_func()
# Create function new_func() in module mymodule.py
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Editor: install a package by simply calling the package’s function

A
resp = requests.get(url)
# alt+enter
# 'Install and import package 'requests'
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Editor > Live Templates

A

main turns into ‘if __name__ == ‘__main__’
Search settings for ‘Live Templates’ to edit templates

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Hot key for arguments tooltip

A

Ctrl + P

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Turn regular string into f-string

A
print('{e')
# autocompletion pop-up with available variables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

To enhance autocomplete…

A

provide type hints
~~~
def my_func(arg) -> Optional[User]
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to discover new features?

A

Open action palette and search for stuff:
~~~
Ctrl + Shift + A
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Find usages

A

F7

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Pre-commit settings

A

You can optimize imports and reformat the code in the commit window

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Select only certain changes for a commit

A

In the git palette on the left click ‘diff’ icon and press checkmarks next to the changes you want to include

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Create label in local history

A

Right click - Local history - Put label…

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

‘Refactor this’ hotkey

A

Ctrl + Alt + Shift + T
^ T (Mac)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

5 Main Refactor tools

A
1. Extract/introduce Variable/Constant/Parameter Object/Method/Field/Superclass
2. Inline is the opposite of extract/introduce
3. Pull class members up/down
4. Move (a class) to another file (or drag and drop them)
5. Move to a package
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Visualize only specific tables

A

Select tables and click visualization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Debug: conditional breakpoint

A

Add Condition checkmark
or click More on the breakpoint pop-up

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Profiling the app

A

Click Profile icon (3rd from the Run)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Enable custom config .ideavimrc

A

Click on the IdeaVim icon > Enable .ideavimrc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

My Custom IdeaVim enable/disable hotkey

A

Alt+v
Settings > Keymap > search ‘vim’ > Tools - Alt+v

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

My Custom VCS Next/Previous Change

A

Alt + PgUp
Alt + PgDn

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

My Custom Git Blame hotkey

A

CTRL+SHIFT+ALT+A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Show autocomplete

A

CTRL+Space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Add annotations

A

ALT+Enter
Choose annotation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Change selection CASE

A

Select
Shift x2
type ‘case’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

PyCharm Actions

A

CTRL+SHIFT+A
(show line numbers)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Select a word or a keyword (if)

A

CTRL+W

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Select the whole string or the whole keyword statement (if)

A

CTRL+W+W

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Select the whole string with quote marks

A

CTR+W+W+W

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

Select the whole call within brackets

A

CTR+W+W+W+W

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Shrink the selection

A

CTRL+SHIFT+W

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Move line down

A

Action Palette: CTRL+SHIFT+A
Move Line Down (mld)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

Surround code with boilerplate (try/except etc)

A

CTRL+ALT+T (Ubuntu terminal)
CTRL+SHIFT+A > ‘surround’

37
Q

Return to the previous wrap state (unwrap)

A

CTRL+SHIFT+DELETE

38
Q

Multiple Selection

A

ALT+J at the caret
ALT+J again to the next occurence
(put cursor at ‘th’ <th>Text</th>)

39
Q

Deselect previous occurrence (remove second cursor)

A

ALT+SHIFT+J

40
Q

Select all occurrences in a file

A

CTRL+ALT+SHIFT+J

41
Q

Recent (edited) locations pop-up

A

CTRL+SHIFT+E

42
Q

Navigate between errors or warnings

A

F2
Shift+F2

43
Q

Browse through methods

A

Alt ↓
Alt ↑

44
Q

Go to a line in code
or
a column in a database

A

CTRL+G
CTRL+G :column_name

45
Q

Plugin for hotkey learning

A

Key Promoter X: shows hotkeys for actions.
Suggests creating hotkeys for actions without default hotkeys

46
Q

Custom hotkey for opening database window

A

ALT+D

47
Q

Custom hotkey for Refactoring menu

A

Default: CTRL+SHIFT+ALT+T
Custom: ALT+T

48
Q

Open Services window

A

ALT+8

49
Q

Replace and not insert autocompletion

A

CTRL+SPACE
Select autocompletion
Tab

50
Q

Postfix ‘if is not none’ completion
movies_dict.get(‘year’)

A

Type .if
Select .ifnn for ‘if is not None’

51
Q

Type-matching completion

A

CTRL+SHIFT+SPACE

52
Q

F-string completion

A

{my
Select popped up Autosuggestion

53
Q

Quickly select item from Refactoring Menu

A

Invoke Refactoring Menu: ALT+T
Type ip for ‘Introduce Parameter’

54
Q

Refactor - Rename - Exclude item from renaming

A

SHIFT+F6
Refactoring Preview window at the bottm
Select item to remove
Delete

55
Q

Refactor: Extract Variable

A

CTRL+ALT+V

56
Q

Refactor: Extract Method

A

CTRL+ALT+M

57
Q

Settings: disable code drag-n-drop

A

search for “Move code fragments with drag-and-drop”

58
Q

Recover parts of code from Local History

A

Local history - click on a chevrone

59
Q

Reformat selection/whole file

A

CTRL+ALT+L selection or whole file

60
Q

Reformat settings

A

CTRL+ALT+SHIFT+L

61
Q

Method’s signature

A

Caret in ():
CTRL+P

62
Q

Quick documentation

A

CTRL+Q

63
Q

Pop-up definition at caret

A

CTRL+SHIFT+I

64
Q

Go to the next highlighted error

A

F2

65
Q

Expand warning description

A

CTRL+F1

66
Q

Highlight all usages within a file

A

CTRL+SHIFT+F7

67
Q

Search only for classes

A

CTRL+N

68
Q

Search only files

A

CTRL+SHIFT+N

69
Q

Look for a method or global variable

A

CTRL+ALT+SHIFT+N

70
Q

Search for a whole word in Files window (CTRL+SHIFT+F)

A

CTRL+W

71
Q

Replace in Files window

A

CTRL+SHIFT+R

72
Q

Jump to declaration of method/its usages

A

CTRL+B

73
Q

Detailed view of usages

A

ALT+SHIFT+7

74
Q

Pin the search in Find tab

A

Right Click > Pin

75
Q

Find tab

A

ALT+3

76
Q

See file structure

A

CTRL+F12

77
Q

Recent files window

A

CTRL+E

78
Q

Delete files from recent history

A

DEL

79
Q

Discover your code in recently visited files

A

CTRL+SHIFT+E

80
Q

Set a break point on a line

A

CTRL+F8

81
Q

Run a debugger

A

SHIFT+F9

82
Q

Quick Evaluate a variable in debugger

A

CTRL+ALT+8

83
Q

View type hierarchy

A

CTRL+H

84
Q

View call hierarchy

A
CTRL+ALT+H
85
Q

Using RegEx find ext…Select in ‘Find in files’ window

A
CTRL+SHIFT+F
#enable regex search via ALT+X
ext.*Select
86
Q

Last Edit Location

A
Ctrl+Shift+Backspace
87
Q

Toggle inline hints for codeium

A

ALT+H

88
Q

Disable codeium

A

ALT+C

89
Q

Codeium chat

A

ALT+B