Slide 1

Slide 1 text

A shortcut for your productivity in Android Studio Zhenlei Ji @zhenleiji

Slide 2

Slide 2 text

🗓 Agenda 1. The problem 2. How to develop shortcut mindset? 3. Demo 4. Final considerations

Slide 3

Slide 3 text

😭 The problem

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

jetbrains.com/idea blog.jetbrains.com/idea @intellijidea Default macOS keymap REMEMBER THESE SHORTCUTS Smart code completion Ň Space Search everywhere Double Show intention actions and quick-fixes Ņ↩ Generate code ľN, Ň↩ Parameter info ľP Extend selection Ņņ Shrink selection Ņt Recent files popup ľE Rename F6 GENERAL Open corresponding tool window ľ0...ľ9 Save all ľS Synchronize ľŅY Toggle maximizing editor ľ F12 Inspect current file with current profile Ņ I Quick switch current scheme Ň` Open Settings dialog ľ , Open Project Structure dialog ľ ; Find Action ľ A DEBUGGING Step over/into F8/F7 Smart step into/Step out F7/ F8 Run to cursor ŅF9 Evaluate expression ŅF8 Resume program ľŅR Toggle breakpoint ľF8 View breakpoints ľ F8 SEARCH / REPLACE Search everywhere Double Find ľF Find next/previous ľG/ľ G Replace ľR Find in path ľ F Replace in path ľ R Select next occurrence ŇG Select all occurrences ŇľG Unselect occurrence ŇG EDITING Basic code completion ŇSpace Smart code completion Ň Space Complete statement ľ ↩ Parameter info ľP Quick documentation lookup ľJ, F1 External Doc F1 Brief Info ľ+mouse Show descriptions of error at caret ľF1 Generate code... ľN, Ň↩ Override methods ŇO Implement methods ŇI Surroundwith… ľŅT Comment/uncomment with line comment ľ/ Comment/uncomment with block comment ľŅ/ Extend selection Ņņ Shrink selection Ņt Context info Ň Q Show intention actions and quick-fixes Ņ↩ Reformat code ľŅL Optimize imports ŇŅO Auto-indent line(s) ŇŅI Indent/unindent selected lines / Cut current line to clipboard ľX Copy current line to clipboard ľC Paste from clipboard ľV Paste from recent bu ers... ľ V Duplicate current line ľD Delete line at caret ľ Smart line join Ň J Smart line split ľ↩ Start new line ↩ Toggle case for word at caret or selected block ľ U Select till code block end/start ľŅ [/ľŅ ] Delete to word end Ņ Delete to word start Ņ Expand/collapse code block ľ+/ľ- Expand all ľ + Collapse all ľ - Close active editor tab ľW REFACTORING Copy F5 Move F6 Safe Delete ľDelete Rename F6 Refactor this ŇT Change Signature ľF6 Inline ľŅN Extract Method ľŅM Extract Variable ľŅV Extract Field ľŅF Extract Constant ľŅC Extract Parameter ľŅP NAVIGATION Go to class ľO Go to file ľ O Go to symbol ľŅO Go to next/previous editor tab Ň /Ň Go back to previous tool window F12 Go to editor (from tool window) ۚ Hide active or last active window ۚ Go to line ľL Recent files popup ľE Recent locations popup ľ E Navigate back/forward ľŅ /ľŅ Navigate to last edit location ľ Select current file or symbol in any view ŅF1 Go to declaration ľB, ľClick Go to implementation(s) ľŅB Open quick definition lookup ŅSpace, ľY Go to type declaration Ň B Go to super-method / super-class ľU Go to previous/next method Ňņ/Ňt Move to code block end/start ľŅ[ / ľŅ] File structure popup ľF12 Type hierarchy ŇH Method hierarchy ľ H Call hierarchy ŇŅH Next/Previous highlighted error F2/ F2 Edit source/View source F4/ľt Show navigation bar ŅHome Toggle bookmark F3 Toggle bookmark with mnemonic ŅF3 Go to numbered bookmark Ň0 ...Ň9 Show bookmarks ľF3 COMPILE AND RUN Build project ľF9 Compile selected file, package or module ľ F9 Select configuration and run/debug ŇŅR/D Run/Debug ŇR/D Run context configuration from editor Ň R, Ň D Run anything DoubleŇ USAGE SEARCH Find usages/Find usages in file ŅF7/ľF7 Highlight usages in file ľ F7 Show usages ľŅF7 VCS / LOCAL HISTORY Commit project to VCS ľK Update project from VCS ľT Push commits ľ K ‘VCS’ quick popup ŇV LIVE TEMPLATES Surround with Live Template ľŅJ Insert Live Template ľJ https://resources.jetbrains.com/storage/products/intellij-idea/docs/IntelliJIDEA_ReferenceCard.pdf

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

🤓 How to develop shortcut mindset?

Slide 9

Slide 9 text

1. What is a shortcut?

Slide 10

Slide 10 text

https://www.merriam-webster.com/dictionary/shortcut “a key or combination of keys on a computer keyboard programmed to perform a specific function when pressed”

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

+ Key code

Slide 13

Slide 13 text

2. Create mnemonic

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

command ⌘ X

Slide 16

Slide 16 text

Cut command ⌘ X

Slide 17

Slide 17 text

command ⌘ C

Slide 18

Slide 18 text

Copy Copy command ⌘ C

Slide 19

Slide 19 text

command ⌘ V

Slide 20

Slide 20 text

Paste glue nozzle tip shape command ⌘ V

Slide 21

Slide 21 text

3. Remember less is more

Slide 22

Slide 22 text

Refactoring code Extract • Extract to a Variable • Extract to a Constant • Extract to a Field • Extract to a Parameter • Extract to a Method option ⌥ command ⌘ V option ⌥ command ⌘ C option ⌥ command ⌘ F option ⌥ command ⌘ P option ⌥ command ⌘ M

Slide 23

Slide 23 text

Refactoring code What is this shortcut for? shift F6 Rename

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Refactoring code Remember less T control ⌃ Refactor This Transform Translate

Slide 27

Slide 27 text

Refactoring code Remember less T control ⌃ Refactor This Transform Translate

Slide 28

Slide 28 text

4. Find patterns

Slide 29

Slide 29 text

Find patterns What is shift used for? shift

Slide 30

Slide 30 text

https://www.merriam-webster.com/dictionary/shift “to exchange for or replace by another, to change” shift

Slide 31

Slide 31 text

To switch between open apps Forward tab command ⌘

Slide 32

Slide 32 text

To switch between open apps Backward tab command ⌘ shift

Slide 33

Slide 33 text

Recent files command ⌘ E 👆

Slide 34

Slide 34 text

Recent files command ⌘ E

Slide 35

Slide 35 text

Recent locations command ⌘ E shift 👆

Slide 36

Slide 36 text

Recent locations command ⌘ E shift

Slide 37

Slide 37 text

Paste Choose Content to Paste command ⌘ V shift

Slide 38

Slide 38 text

Find patterns Reuse shortcut from other softwares shift command ⌘ [ shift command ⌘ ]

Slide 39

Slide 39 text

Find patterns Reuse shortcut from other softwares shift command ⌘ [ shift command ⌘ ]

Slide 40

Slide 40 text

5. Progressive learning

Slide 41

Slide 41 text

https://www.theschoolinrosevalley.org/progressive-learning/ “Progressive learning is a pedagogical movement that emphasizes teaching children how to think rather than relying on rote memorization.”

Slide 42

Slide 42 text

https://www.theschoolinrosevalley.org/progressive-learning/ “Progressive learning is a pedagogical movement that emphasizes teaching children how to think rather than relying on rote memorization.”

Slide 43

Slide 43 text

Progressive learning Methodology to remember the shortcuts

Slide 44

Slide 44 text

Progressive learning Methodology to remember the shortcuts

Slide 45

Slide 45 text

Progressive learning Methodology to understand the shortcuts Programming Search the shortcut Execute the shortcut Understand the shortcut exist? Assign a shortcut yes no

Slide 46

Slide 46 text

Search the shortcut Search everywhere shift shift 🙅

Slide 47

Slide 47 text

Search the shortcut Search action A command ⌘ shift

Slide 48

Slide 48 text

Search the shortcut Search action A command ⌘ shift

Slide 49

Slide 49 text

Search the shortcut Search action https://intellij-support.jetbrains.com/hc/en-us/articles/360005137400-Cmd-Shift-A-hotkey-opens-Terminal-with-apropos-search-instead-of-the-Find-Action-dialog A command ⌘ shift

Slide 50

Slide 50 text

Search the shortcut Search action A command ⌘ shift

Slide 51

Slide 51 text

Search the shortcut Search action 👆 A command ⌘ shift

Slide 52

Slide 52 text

Assign a shortcut option ⌥ Enter 㾑

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

Assign a shortcut ⌥F option ⌥ Enter 㾑

Slide 55

Slide 55 text

Assign a shortcut ⌥F option ⌥ Enter 㾑

Slide 56

Slide 56 text

Progressive learning Methodology to understand the shortcuts Programming Search the shortcut Execute shortcut Understand the shortcut exist? Assign a shortcut yes no

Slide 57

Slide 57 text

🧑💻 Demo https://github.com/zhenleiji/shortcut-talk

Slide 58

Slide 58 text

🙌 Final considerations

Slide 59

Slide 59 text

There are more shortcuts to explore

Slide 60

Slide 60 text

Don’t rush to understand all the shortcuts

Slide 61

Slide 61 text

The shortcut set of each person is different

Slide 62

Slide 62 text

Steve Jobs “Learn continually - there's always one more thing to learn!”

Slide 63

Slide 63 text

Thanks

Slide 64

Slide 64 text

@zhenleiji Zhenlei Ji