1 00:00:00,600 --> 00:00:04,210 There's an old proverb that goes give a person a keyboard shortcut and 2 00:00:04,210 --> 00:00:05,830 they'll be more productive. 3 00:00:05,830 --> 00:00:10,380 Teach a person how to learn shortcuts on their own and change the world. 4 00:00:10,380 --> 00:00:12,200 It was something like that, maybe a little more profound. 5 00:00:13,380 --> 00:00:17,090 Now I mentioned earlier that the documentation in IntelliJ is pretty great. 6 00:00:17,090 --> 00:00:18,310 Let's take a quick tour through it. 7 00:00:19,360 --> 00:00:22,150 One thing that I wanted to point out is that IntelliJ IDEA goes to 8 00:00:22,150 --> 00:00:25,450 a lot of effort to make sure you don't need to use your mouse. 9 00:00:25,450 --> 00:00:27,640 It uses a mnemonic approach. 10 00:00:27,640 --> 00:00:29,830 So any time you see something underlined, 11 00:00:29,830 --> 00:00:33,310 it means that you can push that key to make it focus. 12 00:00:33,310 --> 00:00:36,250 It also means that editing text has many handy shortcuts, 13 00:00:36,250 --> 00:00:37,490 and you should know about them. 14 00:00:37,490 --> 00:00:38,750 So let's go ahead and take a look. 15 00:00:38,750 --> 00:00:41,911 So if you come in here and we go under Help, we choose Help Topics. 16 00:00:41,911 --> 00:00:44,795 It's gonna open up a pretty awesome web page that they have, 17 00:00:44,795 --> 00:00:46,391 I'm gonna bring that over here. 18 00:00:50,211 --> 00:00:51,131 At full screen here. 19 00:00:51,131 --> 00:00:55,647 Now I happen to know where the editing is because I've been in this quite a bit 20 00:00:55,647 --> 00:00:57,352 preparing for this course. 21 00:00:57,352 --> 00:01:04,164 And I wanna show you if we go under IntelliJ Editor 22 00:01:04,164 --> 00:01:09,160 > Quick Start > IntelliJ Editor. 23 00:01:09,160 --> 00:01:15,220 And then I wanna show you basic editing procedures, okay. 24 00:01:15,220 --> 00:01:18,990 So they've done a really good job. 25 00:01:18,990 --> 00:01:20,960 Up here there's this key map you can choose and 26 00:01:20,960 --> 00:01:23,530 you can change it to whatever you want to do. 27 00:01:24,540 --> 00:01:27,090 So let's go ahead and keep it where it's at. 28 00:01:27,090 --> 00:01:31,150 So here it says to select the entire text in the current editor tab 29 00:01:31,150 --> 00:01:32,520 do one of the following. 30 00:01:32,520 --> 00:01:35,920 Edit select all or Cmd+A, so that's kind of common in all applications but 31 00:01:35,920 --> 00:01:39,180 if you're here and you press Cmd+A, bam, everything's all selected. 32 00:01:40,670 --> 00:01:43,130 Selecting text with the navigation keys. 33 00:01:43,130 --> 00:01:46,618 To select text from the current care position, press Shift+Alt+Left and 34 00:01:46,618 --> 00:01:48,070 Shift+Alt+Right. 35 00:01:48,070 --> 00:01:50,470 Also you can select one character at a time by pressing Shift but 36 00:01:50,470 --> 00:01:52,780 if you also put Alt on there you can jump a word at a time, right? 37 00:01:52,780 --> 00:01:54,401 That's pretty cool, might have seen that. 38 00:01:54,401 --> 00:01:57,262 That kinda works on all word processing places up and 39 00:01:57,262 --> 00:02:00,782 down resting your hold down shift and it's kind of highlighting. 40 00:02:00,782 --> 00:02:02,520 And you can cut copy that way. 41 00:02:04,980 --> 00:02:07,550 You can do Page Up and Page Down a Mac. 42 00:02:07,550 --> 00:02:11,080 That's with the Function key, if you don't have that on your keyboard. 43 00:02:11,080 --> 00:02:15,420 So if I do Shift+Function+Up. 44 00:02:15,420 --> 00:02:18,780 Home and End on a Mac are with the Shift+Function+Right, right? 45 00:02:20,000 --> 00:02:24,140 So if I was in the middle of this, and if I don't press down Shift I just hold Alt I 46 00:02:24,140 --> 00:02:26,340 can jump my cursor around that way too. 47 00:02:26,340 --> 00:02:28,610 So, I'm gonna go to the front of the line, so 48 00:02:28,610 --> 00:02:33,630 I'm gonna do Shift+Function+Left, and I'm gonna go to the end and do Right. 49 00:02:33,630 --> 00:02:35,250 So that's Home and End. 50 00:02:35,250 --> 00:02:36,991 You might see there in their dock it says that. 51 00:02:38,611 --> 00:02:42,128 This is a super cool feature here, this extending selection. 52 00:02:42,128 --> 00:02:43,750 To select that, we're not going to hold down the Shift key, 53 00:02:43,750 --> 00:02:46,330 we're just going to hold down the Alt key, I'm gonna press Up and 54 00:02:46,330 --> 00:02:49,640 it knows that it extended to the word that I was on. 55 00:02:49,640 --> 00:02:52,680 But I can go more and I can get the whole index as well. 56 00:02:52,680 --> 00:02:56,403 And then it's gonna go up again, and then it's gonna get all the arguments and 57 00:02:56,403 --> 00:02:58,980 then it's gonna get the entire line. 58 00:02:58,980 --> 00:03:01,330 Then it's going to get the entire line including that and 59 00:03:01,330 --> 00:03:03,580 then up again, and up again. 60 00:03:03,580 --> 00:03:05,370 And then now we've got the whole while block. 61 00:03:05,370 --> 00:03:06,980 Now we got all the while. 62 00:03:06,980 --> 00:03:08,780 So it knows about the code, right? 63 00:03:08,780 --> 00:03:11,710 And then if I'm going to jump it will get the whole class. 64 00:03:11,710 --> 00:03:12,210 Pretty cool right? 65 00:03:15,191 --> 00:03:18,240 And down works the same way so you go down with that. 66 00:03:18,240 --> 00:03:20,690 So, there's some multi-selection, there's some more steps are here. 67 00:03:22,070 --> 00:03:23,690 So, don't get overwhelmed. 68 00:03:23,690 --> 00:03:26,820 I want to pop over really quick to commenting, because 69 00:03:26,820 --> 00:03:31,040 this is something that I find very helpful when I'm trying to walk through and 70 00:03:31,040 --> 00:03:32,140 really learn the language. 71 00:03:32,140 --> 00:03:35,520 You might want to learn how to comment and un-comment lines. 72 00:03:35,520 --> 00:03:39,920 So, basically all you need to do is get you cursor. 73 00:03:39,920 --> 00:03:43,530 Here, like let's say we don't want this reader anymore and I'm gonna comment it, 74 00:03:43,530 --> 00:03:45,298 so I'm gonna press CMD+Slash. 75 00:03:45,298 --> 00:03:50,400 See, It drops a comment at the front and I can undo it as well. 76 00:03:50,400 --> 00:03:51,790 I can do that with multiple lines, so 77 00:03:51,790 --> 00:03:54,870 I can get rid of this whole thing inside the try block here. 78 00:03:54,870 --> 00:03:58,041 But, if you wanted to do it properly with Java, 79 00:03:58,041 --> 00:04:02,370 you can actually hold Cmd+Alt+Forward Slash, we'll push that. 80 00:04:02,370 --> 00:04:04,571 So see it's got the proper star slash star there. 81 00:04:04,571 --> 00:04:08,291 And you can undo with Cmd+Z. 82 00:04:13,111 --> 00:04:13,762 All right, and here, this is a great one. 83 00:04:13,762 --> 00:04:17,060 Adding, deleting and moving lines. 84 00:04:17,060 --> 00:04:18,450 This is something that we do all the time, right? 85 00:04:18,450 --> 00:04:20,650 We wanna move lines around, we wanna change them so, 86 00:04:22,440 --> 00:04:26,110 one of my favorite things to do, let's say that we wanted to duplicate this here. 87 00:04:26,110 --> 00:04:27,110 We wanted to write something else so 88 00:04:27,110 --> 00:04:30,140 if we do Cmd+D, it will automatically duplicate the line. 89 00:04:30,140 --> 00:04:33,700 So, I could've obviously selected the line, copied, 90 00:04:33,700 --> 00:04:37,290 pasted but just duplicating it is pretty handy. 91 00:04:37,290 --> 00:04:40,271 And delete an entire line with Cmd+Backspace. 92 00:04:40,271 --> 00:04:44,532 We can also move lines around. 93 00:04:44,532 --> 00:04:48,564 This is pretty handy so I if do Cmd+Shift+Up, see I can move this line and 94 00:04:48,564 --> 00:04:50,852 see how it's jumping in the right place. 95 00:04:50,852 --> 00:04:54,060 It's jumping in a different part of the code there. 96 00:04:54,060 --> 00:04:54,560 Pretty handy. 97 00:04:57,020 --> 00:05:01,380 So I also wanted to show you that, let's accidentally delete this line and 98 00:05:01,380 --> 00:05:04,960 I can of course, undo it and I can redo what I did. 99 00:05:04,960 --> 00:05:09,530 So Shift+Cmd+Z or Shift+Ctrl+Z, right? 100 00:05:09,530 --> 00:05:12,520 One thing also that I wanted to show, let's say that I heard about another 101 00:05:12,520 --> 00:05:16,250 editor and I got kinda jealous cuz I know Sublime Text has this multiple cursors 102 00:05:16,250 --> 00:05:18,420 thing and I was wondering if this editor supported it. 103 00:05:18,420 --> 00:05:21,190 So I could go over to the search, I could come up here and 104 00:05:21,190 --> 00:05:23,080 I could just start typing. 105 00:05:23,080 --> 00:05:25,100 Well oh, look, multi-cursor, it does have it. 106 00:05:26,370 --> 00:05:27,650 Cool. You should check this out, 107 00:05:27,650 --> 00:05:28,310 this is really cool. 108 00:05:28,310 --> 00:05:30,490 We'll go over this here in a little bit. 109 00:05:30,490 --> 00:05:31,550 And if you scroll down, 110 00:05:31,550 --> 00:05:34,040 you can see that they're all kind of locked together, right? 111 00:05:34,040 --> 00:05:36,950 So here's the selecting text that we had, that we were looking at before. 112 00:05:36,950 --> 00:05:39,680 So you kinda get in this one of those documentation holes here but 113 00:05:39,680 --> 00:05:42,560 it's a lot of fun learning what you can do with this editor. 114 00:05:42,560 --> 00:05:43,080 Here's the Help. 115 00:05:43,080 --> 00:05:45,590 Are you feeling more productive already? 116 00:05:45,590 --> 00:05:46,238 Well, check this out. 117 00:05:46,238 --> 00:05:51,930 Over here in Help, there's a thing called Productivity Guide. 118 00:05:53,320 --> 00:05:56,660 This is great, it shows they're grouped by different things and 119 00:05:56,660 --> 00:05:59,510 they show how many times that you've used them. 120 00:05:59,510 --> 00:06:01,930 And I find this as well, that I should use this. 121 00:06:01,930 --> 00:06:06,965 And if you open it up, it'll show you great hints about what's going on, okay? 122 00:06:06,965 --> 00:06:09,790 So I think that 123 00:06:09,790 --> 00:06:13,168 you should come back here whenever you feel the itch to explore things more. 124 00:06:13,168 --> 00:06:16,500 Don't get overwhelmed, but just keep on coming back and learning more every time, 125 00:06:16,500 --> 00:06:19,300 cause the more you learn this, the more productive you'll be. 126 00:06:20,440 --> 00:06:23,670 Oh, and finally, I wanna show you the motherload of keyboard shortcuts. 127 00:06:23,670 --> 00:06:28,961 So you go Help > Default Keymap Reference. 128 00:06:28,961 --> 00:06:33,440 It's gonna open up a PDF. 129 00:06:33,440 --> 00:06:35,420 Wow, right? 130 00:06:35,420 --> 00:06:36,590 That'd make a great tattoo. 131 00:06:38,080 --> 00:06:40,350 It makes sense that the help is also large. 132 00:06:40,350 --> 00:06:42,440 IDEs do a lot of things. 133 00:06:42,440 --> 00:06:45,400 I've added a bunch of directions on the teacher's notes. 134 00:06:45,400 --> 00:06:47,500 Remember to use that productivity guide every once and 135 00:06:47,500 --> 00:06:49,610 a while to pick up new tricks. 136 00:06:49,610 --> 00:06:50,770 After you get the hang of it, 137 00:06:50,770 --> 00:06:54,480 show off your tricks to your friends, it's more impressive than juggling. 138 00:06:54,480 --> 00:06:56,770 If you find something that you love, come and share it on the forum. 139 00:06:57,970 --> 00:07:00,700 I plan to make several workshops on the greatest IDE hits 140 00:07:00,700 --> 00:07:04,000 showing off the favorite tricks and tips from different editors. 141 00:07:04,000 --> 00:07:06,520 Also Android Studio uses IntelliJ, so 142 00:07:06,520 --> 00:07:08,360 all the stuff you earn here, will work there too. 143 00:07:09,600 --> 00:07:12,610 We have a amazing set of Android questions here on Treehouse and 144 00:07:12,610 --> 00:07:14,820 with your new super powers, you're already productive. 145 00:07:16,130 --> 00:07:17,900 Now that you're getting comfortable with the editor and 146 00:07:17,900 --> 00:07:20,620 navigating around, let's practice it some more and 147 00:07:20,620 --> 00:07:24,040 introduce some more advanced tooling, right after you wrap up this exercise.