1 00:00:01,180 --> 00:00:08,340 In this video we're going to set up our terminal to look nice along our newly set up Sublime Text. 2 00:00:08,350 --> 00:00:14,620 As you know the terminal is just a text based way to communicate with the computer instead of the 3 00:00:14,620 --> 00:00:22,030 Graphical User Interface that we normally use. As developers you will spend a lot of time with the terminal. 4 00:00:22,030 --> 00:00:24,950 Especially as you become more and more senior in your role. 5 00:00:25,690 --> 00:00:27,070 So let's make it better. 6 00:00:27,970 --> 00:00:36,120 If we open up the terminal - I have it open already for myself, you see that we have the word 'bash' here. 7 00:00:36,120 --> 00:00:41,640 BASH is a type of shell that a terminal can have. 8 00:00:41,700 --> 00:00:43,480 And what do I mean by that? 9 00:00:43,740 --> 00:00:50,690 Just as the name suggests, it's just the casing around the terminal that is customizable. 10 00:00:50,700 --> 00:00:53,930 There's actually more than one shell. 11 00:00:53,940 --> 00:00:55,400 Bash is just one of them. 12 00:00:55,740 --> 00:00:58,320 One of my favorites are 'Oh my ZSH'. 13 00:00:58,360 --> 00:01:06,690 There's the 'Fish shell' and they all have different things that you can do with them, 14 00:01:06,690 --> 00:01:10,800 but it's just another way to customize your workstation. 15 00:01:10,800 --> 00:01:18,540 Before I get into that, let's just customize our 'bash'. The way we do that is we can first start off with 16 00:01:18,720 --> 00:01:25,680 getting something other than just having this to the left. The way we do that is we type in 'nano' 17 00:01:25,800 --> 00:01:37,170 which is a text editor and then we do '~/.bash_profile'. And here what we open 18 00:01:37,200 --> 00:01:43,140 is a file that is the bash profile. So this is what our profile will look like. 19 00:01:43,140 --> 00:01:48,810 This file gets read every time we open up the terminal. In here we can put in a bunch of things that 20 00:01:48,810 --> 00:01:50,550 we want our terminal to do. 21 00:01:50,550 --> 00:01:58,560 One of the cool things that I really think is fun is updating your 'PS1' variable. And I'll link to 22 00:01:58,560 --> 00:01:59,540 this website. 23 00:01:59,940 --> 00:02:01,960 And there's a bunch of examples here that we can use. 24 00:02:01,960 --> 00:02:05,820 Let's just pick one that - like this one over here. 25 00:02:05,820 --> 00:02:09,090 All we do is copy and paste this. 26 00:02:09,300 --> 00:02:13,920 And within our bash profile we can just copy and paste. 27 00:02:14,150 --> 00:02:18,920 And as you can see our PS1 now equals a whole bunch of gibberish that we don't really need to worry 28 00:02:18,920 --> 00:02:19,390 about. 29 00:02:19,520 --> 00:02:25,220 We see over here that to exit we need to do Ctrl-X then save modified, 30 00:02:25,220 --> 00:02:28,230 we just press 'Y' and then press 'Enter'. 31 00:02:29,490 --> 00:02:41,030 OK, nothing happens but the way we fix that is we now do 'source' and then '~/.bash_profile'. It essentially reloads 32 00:02:41,030 --> 00:02:44,090 our profile now. And look at that. 33 00:02:44,270 --> 00:02:50,840 We now have a cool little prompt to the left. So you can set up your PS1 to display whatever you want. 34 00:02:50,840 --> 00:02:54,080 If you want to your current directory to display, 35 00:02:54,080 --> 00:02:56,210 that's great. If you want your username to display, 36 00:02:56,210 --> 00:02:57,870 that's good as well. 37 00:02:57,950 --> 00:03:00,400 You can set up in a ton of ways. 38 00:03:00,410 --> 00:03:05,670 The other thing that the terminal lets you do, if you click on something like a background color, 39 00:03:05,880 --> 00:03:09,070 You'll get a few things that you can change in your shell. 40 00:03:09,110 --> 00:03:12,910 You can change your color based on what you want. 41 00:03:13,280 --> 00:03:20,420 And if I bring this over here you can also click on the profile and actually it gives you a bunch of 42 00:03:20,600 --> 00:03:22,920 pre-built ones that look really cool. 43 00:03:22,940 --> 00:03:24,630 This is 'Pro' actually very nice. 44 00:03:24,800 --> 00:03:26,870 Again you can customize this as well. 45 00:03:26,900 --> 00:03:32,570 And as I mentioned a different operating system, you have your own ways to customize it. 46 00:03:32,810 --> 00:03:39,110 But every single one usually has a profile and a way to modify what gets displayed based on your needs. 47 00:03:39,110 --> 00:03:47,660 Now the one that I really really like, is a shell that's different than bash and I've used this one before 48 00:03:47,660 --> 00:03:51,670 which is really really good it has a ton of themes that you can use. 49 00:03:51,680 --> 00:03:54,100 They have a bunch of options and you can play through them. 50 00:03:54,230 --> 00:03:56,740 The one that I really like is the 'Fish Shell'. 51 00:03:56,750 --> 00:03:58,130 It's very simple. 52 00:03:58,160 --> 00:04:06,060 It has all the operating systems on it and I install it using 'homebrew'. For those on a Mac, Homebrew is 53 00:04:06,480 --> 00:04:09,060 a way to install anything from the web. 54 00:04:09,060 --> 00:04:15,090 So instead of me going to a website and installing something, I can use a command line to download things. 55 00:04:15,090 --> 00:04:21,660 If you go to the Homebrew website, brew.sh, You can actually just copy this link into your terminal 56 00:04:21,870 --> 00:04:22,740 copy and paste it. 57 00:04:22,740 --> 00:04:25,970 Press enter and it will install homebrew for you. 58 00:04:26,870 --> 00:04:34,140 I already have this installed, so I'll just exit that. The way I install fish - 59 00:04:34,180 --> 00:04:39,770 you can see over here all I have to do is say "brew install fish" 60 00:04:39,980 --> 00:04:45,550 And while this is happening, I want to show you another option. So we have the terminal over here, 61 00:04:45,650 --> 00:04:53,000 But 'iterm' which again is specific for Mac is really really nice and it's way more customizable than 62 00:04:53,000 --> 00:04:53,870 the terminal. 63 00:04:53,870 --> 00:05:05,010 So I prefer using 'iterm2'. If I open this and double click and look at that. This looks way nicer already. 64 00:05:06,650 --> 00:05:08,840 So let's just compare them side by side. 65 00:05:10,820 --> 00:05:13,950 I have my - let's make that a little bit bigger, 66 00:05:13,970 --> 00:05:19,770 I have the bash shell here and I have the fish shell here. 67 00:05:20,970 --> 00:05:27,500 Although they both are in the desktop right now they're running on different shells. 68 00:05:27,810 --> 00:05:34,730 The fish shell has - just like we have with the 'bash_profile', has its own profile. 69 00:05:35,220 --> 00:05:41,780 So you can set it up. And you can set up which one gets activated when you first open up the terminal 70 00:05:41,780 --> 00:05:49,170 or iterm. What I recommend is to set up your workstation in a way that's nice to you. 71 00:05:49,200 --> 00:05:54,030 My preferred way is to use iterm and the fish shell. 72 00:05:54,220 --> 00:05:56,680 But if you want to use bash that's great. 73 00:05:56,680 --> 00:06:03,340 The beauty here is that if I type in 'bash', I get taken to the bash profile. And if I type in 'fish', 74 00:06:03,340 --> 00:06:05,450 I get back to fish. 75 00:06:05,460 --> 00:06:12,310 iterm also lets you just customize everything really nicely. If I go to Preferences, you'll see here that 76 00:06:12,430 --> 00:06:19,690 I have Appearance, Profiles, where we can have Colors set up. And there's a ton more you can do with your 77 00:06:19,690 --> 00:06:25,160 terminal. But I won't get into in this video because everybody has their own way of doing things. 78 00:06:25,180 --> 00:06:34,470 I just wanted to show you a basic setup, so that now you have a nice environment that you can work at. 79 00:06:34,640 --> 00:06:36,510 I'll see you in the next one. Bye bye