Configuring iTerm2 for your Mac (the best terminal for development in MacOS) - Homebrew, Zsh, etc.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
thank you so let's download I term two go to Chrome like term two downloaded and we'll click here let's drag it to the applications folder and the launch pad should pop up here any moment here it is so yeah it's okay to alarm to allow for notifications no problem you can always turn off that later so let's put this thing over here let's make it get the whole window here the very first thing you want to do is go to settings as you can see you can just type command comma and that's gonna open the settings uh the very first thing go to appearance theme I like to put on minimal and control comma again go to profile text and make the phone to 20. that's good enough I mean it's gonna make the window bigger so yeah like that one thing I want to do now is go to control comma again notice you have this exclamation mark here click on the exclamation marks gonna tell you to open the system preferences open system preferences go to desktop and dock and then close the windows when creating an application disable that and then you see that it goes away so now you have the more options here but what you want to do now is close this with this thing here you can go to window save window arrangement then you can type a name for this Arrangement let's put Center or centered okay and then now when you go to settings again Arrangements this is your default Arrangements it has a star here so what you're gonna do now is go to General open the file the file Windows window arrangement great now when you close I term and reopen it it goes to the arrangement that you set so one thing you want to do here is for example if you type a command I think GPS and then you hold command the arrow keys it doesn't move the question doesn't move even worse if you hold the option to key and use the arrows it doesn't move and give it the arrow so we have to fix that so to fix that we go to control comma let me go to profiles we go to keys and then we go to key mappings and then we go to presets necro text editing and then we can remove the previous ones no big deal here and then great now if you do a git clone https and you type command Arrow you go to the beginning of this line or to the end of the line and even better if you press option and then use the arrows you go through the tokens one at a time that's very useful to when you're typing commands in the shell okay now what we're gonna do is go to command comma and then go to profiles and then choose reuse previous sessions directory the way that works is now when you change the directory here and then you open a new tab your new tab is going to land in the same directory of the previous tab even if you do like a split pane like this let's split vertically the directory is going to be the same so that's very useful another thing you want to do let's go come and comma again profile and go to window and then terminal actually and then you do a silent spell that was kind of annoying and here you do unlimited scroll back so you don't have to worry about that and then now you click on appearance you click on Windows show window number in title bar just select that so the number disappears see and then tabs you don't want to see the tab number and then pings you set up our speed paints just select that see so you don't see the that thing over there and then now now it's it's much better you can adjust this thing here and it's much better last thing you want to do here now is go through again common comma and go to closing and then confirm closing with post sessions and uncheck this thing here and then check quit when all windows are closed so for example now if you close that you are automatically closes another thing you want to do here is every time you open a new window for example let's open a new tab this annoying message shows up here so the way to take this off is go to your home directory and do like a touch push login and then that's it now you have this file there and now if you close it and open the message is gone so now we're going to talk about the most important thing which is the Z shell RC file let's open that file with VI and on that file we can write whatever we want that's going to get executed when the session starts so let's do a echo hello here just as an example save it and now every time you close and open the terminal the file gets executed and the echo message is shown if you open a an another tab the same thing happens notice that if you open a pen if you split the pen horizontally same thing so that file is executed every time you open a new tab Windows session and let's go now and delete the message of this file and let's do something to change the title of our terminal and we do that with a command that we're going to add to the file to the Z shell RC file so by pasting that code here and changing for whatever you want uh what happens is when this file now gets executed automatically the title of your windows and tabs are going to change see so if you open another tab uh the same title but notice that that is some kind of Z shell Z as H they are showing that we don't want to so how do we so we do common comma and then we click on profiles General and then we go to the title and select session name and also go back and unselect job name so now you only have the session name showing and that's what you can see now the title doesn't show the job name just the session name if you open a new one you can see that it's just showing the the name so that's why we want it so just to recap if you go ahead and Cat the Z shell RC file you see the the commands that are being executed so now let's start configuring our Z cell RC file to do a lot of cool things to our terminal so let's open the Z shell RC and the first thing I want to do here I'm going to create some alias they are very useful when you're using the terminal so I have a file here with a bunch of aliens the ones I want to start creating are those ones here which as you can see basically what I'm doing is I'm grabbing with color I'm using C for clear and then LL is becomes this thing here this one here ah it's too complicated for now let me delete this one and yeah and then for example now if I go out and Source my Z shell RC I can use those datas for example C clear the screen LL now gives me like a list of directors if I want to see the ages I have created I type Alias enter and here are all the areas that I that I created and one thing because we're going to be editing the Z shell RC file so much it's good to create a shortcut for that as well so let's go there Z CRC and now I'm gonna I'm gonna use those two Alias here which are very useful so I come here I'm gonna add those Sailors here right so basically VZ I'm gonna VI this file and SZ like Source Z I'm gonna Source it so let's let me get out here let's switch this thing again because we made modifications and now if you type VZ you go straight to the file and then you create whatever you want here for example uh alias uh High equal Echo hi and then now if you want to Source this you just type SZ and then you get this message the source and then if you type Pi you get a high on the screen so yeah that's a quick and and an easy way to to edit the Z the Z shells RC files so let's do it again VZ let's delete this High areas it's not very interesting save it and then remember to Source it the interesting things like because we just removed and it is if you type high it's going to be there again so you're gonna have to do here on alias hi and then how high it's gone so again if you close the the terminal and reopen it the Z cell file these cell RC files is executed and all your eight is are there again one more thing I want to do here if you type LL which again is our Alias for LS minus lah you can quickly check that here uh note that we have we don't have any colors let let me add some colors here so let's go to the Z shell RC and copy those lines here those are the lines they're gonna allow you to have colors on your terminal or the ls command so I get out here I Source my the show RC file and now when I type LL I see the colors so that makes it more appealing uh by the way all my lines from my Z shell RC file are going to be listed in the description of this video so you don't need to copy from the video itself so yeah that's it a couple more Alias I want to add which are very helpful are the IP addresses I often need to know the internal and external IP address of my machine so I use some nice Alias for that so let's do VZ to edit the Z shell RC file and copy those lines here I mean you don't need to understand how that works I mean you can bash itself it's a language that has a lot of features but this is the command you need to execute to know your internal IP and your external IP so let's get out of this Source it and now if I type IP I see my internal IP if I type my IP I see my external IP on the terminal that's very handy I use that all the time another thing I want to do is related to the path so let's create a new Alias here uh there is I'm talking about is this one here with prints the path in a very nice way I like that a lot too so you come here that said this Get Out Source the to show us your file and now when you type path list your path in a very nice way so that's going to come handy when we add applications and libraries here we're going to be able to see the path okay it is about time we change our prompt look how ugly our pump is let's make it beautiful give it some colors and some meanings to do that I'm gonna go inside my Z shell RC file and copy those lines here those cryptic lines here okay so let's first do it so you see how it looks so I can put here on the beginning of my Z shell file create and then I Source it and then boom look look how nice they look uh you have the time you have some kind of name and you have and then if you go to this directory for example downloads it shows the directory you are and I mean you have total flexibility some people love to put like the get branches and information on the prompt so they know uh what what are they working with when they're they're working for git Repository uh so instead of me trying to explain you why and how that came to be this line here I'm gonna give you a a URL a an article that explains very well this this concept here so here I'm gonna again I'm gonna put this URL this link on the description of my video here it explains everything about how you should do it and how you can do callers Day times directory variables and I think also explains about get here too uh yeah that's how you get some information here the branch so yeah I suggest you read this article if you wanna learn how to to change your prompt or you just if you like mine for example here I'm I put the computer name so to change that you go to VC look for this computer name here then change it to M1 and now if you Source it now you have M1 showing instead of M2 another thing I forgot to mention uh regarding colors uh if you go here you see that I'm using colors but here for example I use a code instead of a color so how do you know that there is another article very good and again I'm gonna paste the link in the description of this video with all these colors so these are all the codes you can use on bash for colors I'm gonna put this URL in the description as well okay now comes the fun part let's install Homebrew so you can install a bunch of applications and utilities straight from the terminal so to install Homebrew first let's make sure we are this is our M1 machine so if you type arm no Arc it tells you arm 64 which is like apple silicon so let's go install Homebrew for Apple silicon you go to this website here again links are going to be in the description and you simply copy this line here paste it here type your password and it's gonna stop boo it's gonna take some time I'm gonna fast forward so after a couple of minutes it finish installing blue but if you type do it doesn't work that's because you need to add blue to the path so if you go to the website that we are using uh down here it mentions that so just copy this thing here open your Z cell RC file and add this thing here to the top or whatever you want let's make a comment path or home brew okay and now if you Source it and type path you see that Homebrew is correctly added to the path now if you do Brew version Homebrew is installed one thing I want to mention here which is very important is if you type path you see it there but if you Source it again and type f look what happens it's duplicating the the path so if you keep sourcing eventually you're gonna have like a very big path with a bunch of duplicated uh folders to fix that we're gonna use another file which is the Z shell profile no Z profile actually dot Z profile and that file is executing only once during the session only when you open the terminal and never again so that's the perfect place to put the the path so let's come to the to the the previous file which is the Z shell RC that is let's copy this and delete it it won't be here anymore okay let's open the Z profile and let's add it here great now what happens is when you close your item and open again and do path Homebrew is there homebrews you work working as you can see but if you Source it it doesn't add again because now the path is not in the Z cell or C is on the Z profile file which is executing only once that's the place you want to do your path configuration again it's Z profile and I'm going to add those lines to the description of this video so now that we have Homebrew installed let's store some fun applications here to start applications in blue is very easy where you just type blue install for example we don't have the baguette in our system and that's a very useful uh application to have so that's the Brew install that we get and that's how you do and download and install the latest version of the big ad and then now we have the beginning assistant uh great so let's start something fun let's start cow say we will install cow say basically now when you type call say hello you have this cute cow saying hello to you in in your terminal I make it even better I use the Alias to to make it look better so let's go to a VZ z z shell RC file and I created this function here which is similar to a native but gives you more flexibility so basically it's a call function that's going to say call say and then it's going to do an echo just to give like a line so basically now when you do calls say hello that's what you get but if you source the Z cell RC file with my my function cow right now cow it's not working because I haven't sourced it yet but if you go ahead and source and then do a call call hello it just gives like a prints it prints the same thing and gives like a new line here just to make it look more organized more beautiful and then yeah you can do this the whole day hello world oops it looks like you need hello world nice and let's start something cool too which is Fortune we'll install Fortune and let's wait for it great so now if you do Fortune it it gives a coat uh and what I like to do actually is is install another function so let's go to the Z shell let's go here and I do this coat one so let's go to here both function I mean you can type whatever you want it's pretty much like the fortune with spaces again if you do Fortune that's what you get I like spaces so let's source these shells rc5 and now if you do Fortune not Fortune sorry coat you got spaces like lines in between here and one thing you can can do which is very nice I think you can do like how Fortune no that doesn't work uh you can do huh maybe cow Fortune grab cow yep see so very much you're piping the output of Fortune to your function call and then you get the the couch you see the code for you so to wrap up like with Boone stall you can install a lot of different applications and if you do real list you'll tell you what you have installed and if you want to uninstall something you can do uninstall for example if you want to install the big ad just do a brew and install that baguette and now the baguette's gone and that's it I mean I think I'm gonna wrap up here for item with blue and Z shell that's pretty much everything you need and yeah I hope you like this video again this is a fairly new channel that's my second video so if you can help out and subscribe and and like it I will appreciate it it would help a lot and yeah I hope to provide more interesting videos in the near future
Info
Channel: Let Me Draw It
Views: 16,254
Rating: undefined out of 5
Keywords:
Id: x71E30VtEwM
Channel Id: undefined
Length: 27min 10sec (1630 seconds)
Published: Mon Jan 16 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.