Console Terminal Customisation with ZSH + Starship (plugins & themes)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone welcome back to the channel Tech with Marco in one of my last videos I talked about why you should care about your dot files and why it is important to know how they work and I got a comment asking what my terminal setup looks like and what software I use for that so I decided to walk through my terminal setup with you and show you guys what software I use and how you can achieve that on your own machine so let's get started hi I'm Marco I'm a software devel velop ER and the devops engineer and you go to YouTube channel for all kind of Tech rated stuff and if you haven't subscribed yet I think now it's a good time to do so and yeah just leave a thumbs up and leave a comment if you enjoyed the video thanks so first of all there are two things to know I used the terminal application which is called Tabby and for that I use the shell Z shell so I'm opening my terminal here and my Z shell configuration right next to it so that we can have a closer look at that so on the left side you see my terminal tab here and I just guide through the settings really quick so you can customize that with a different font you can uh set up the font size for example uh and much more different uh stuff here so you can configure different profiles and connections and uh some terminal settings here and yeah the the most important one I guess is the color scheme here and I use the material color scheme here and with Tabby here you can also use that to configure your settings but I use my DOT files configurations repository for that to synchronize my configuration file here so this on the left side here is my Z shell now and as you already see it has some uh styling modifications to it and for that I used the software which is called Starship so Starship is able to modify your shell prompt and with Starship you get so many configuration options that I can't walk through all of that but uh the most important ones here are the prompt configuration um there are different examples here how you can achieve different settings um and I would really recommend playing with that so you can find your um preferred setting here um I link my Starship configuration in the description below because they're in my DOT files repository uh you can find them at any time and I try to keep them updated so there is also uh different stuff to configure for example for AWS uh you can uh configure stuff uh for net for docka and Java and yeah so so much more things uh just play around with it and um yeah they also have nice presets and what what I did I took uh one or two presets and I had a look at them and I just loaded them into my shell here and from there on I continue to customize it on my own uh wishes so uh feel free to also use My Starship configuration as I said it's linked in the description below so let's have a closer look at my Starship configuration uh the default path is in thec config folder and then there's a file which is called star sh. TL and I start with adding a new line which is set TOA so that means this prompt here is not starting a new line so I have a format of my prompt in two lines so I start with character OS host name directory and then if applicable the git Branch the git status python uh the time and the command duration and these variables they refer to um all the for example the character here it refers to the character configuration in line 10 here and I configured two symbols here so the success symbol and the error symbol so that means every time something is successful in my shell um I have a success symbol here and that for me is the rocket and if something is not working uh because the command was not found the ASD for example here I have the error symbol which is the flame which symbolizes fire or emergency so just play around with some symbols here so there's another cool feature for Starship which is related to the time so as you can see the time here is uh shown at what time the command finished but sometimes there is a lot time between this time and at this time here so I configured the CMD duration time here on the right and that shows me how long the last command took so I can sleep my shell here for 5 seconds and then we will see at the side here last command took 5 seconds so this sometimes helps me to see how long a command took and sometimes that's quite helpful but sometimes it's also not very helpful but uh just a cool thing to play with so let's have a closer look at the directory configuration here uh I have the tration length of three set so that means um every three directories um I have this name of the directory shrink two and now the next line here are two characters so for example switching into the G directory as you can see there're still G visible then I change into the next one here for example my work directory it is still visible and now we have three directories here home directory git and work and the next directory will uh shrink these three to um smaller ones so let's head into for example this one here and now we have um my home folder here then G then work and then this Mups here for example um quite nice to still have an overview what the full working directory is but it's not taking up so much space so now we can have a look at the git configurations here um I have a symbol for git and um this appears when I am in a git directory and this is the case here so I'll just go to another one and there you can see that we have a git directory here and we are two commits ahead of the origin uh in my local git repository so that shows me or tells me I have to push two commit commits but I won't do it because um these are just some test commits but as you can see I can now like add a file and uh there you can see this little uneven symbol I don't know the English name for that but uh this shows me oh yeah untracked so this shows me I have uh an untra file in my directory here and I still have to add it to my uh working tree so I can add that and then you will see I have a Plus+ symbol and um yeah one file is added so this shows me I am one uh file ahead here and I I could add that um to my um pushing working tree and now you can see this number changed from two to number three so this visualized really good how your git repository is uh on your local machine and this helps me to yeah decide when to do what so I don't have to do good status all the time um yeah but just some nice information to have another cool feature of Starship is for example the um python visualization so um sometimes I'm using um virtual environments when I'm uh when I have python projects so um I'm now in a repository where I know I have a a vent folder for virtual environment and I can source that men bin activate folder and now you can see that I'm here at P en um version 311 so yeah just some nice python features here but now let's switch from the visual changes to real useful functionalities as I'm using Z shell I'm able to load plugins into my Z shell startup so so that means um I can extend my shell with some specific functionalities and that is done in the do Z shell RSC file so first of all we export our zshell home directory and that one is uh do zsh folder in my home directory and now I can use that Zell variable in my scripting here in the next lines I'm loading autoc completions so that that makes me able to use tab to autocomplete different um commands in the Shell here uh quite useful uh the next four lines there are just plain styling so um that I have the possibility to have a selectable menu with my arrow keys I can use the tab completion with case and sensitive uh settings here um I am completing directories with Dot and two dot so special geers is set to true um the output is uh a bit colorized and that one here is just colorized output for the uh kill command what I then do is I change some um history sourcing settings here so let's have a look at the uh history settings file here so I set the history size to a very high number so that makes me able to um yeah just go mostly indefinitely through my history and I'm saving that in the Z history file and I set some options here to append the history file to share the history amongst different uh tabs of my shell so um if I have two tabs of shells open here then if I type a command in the first shell and press enter then it's appearing immediately in the next one sometimes it's quite helpful to have that um I ignore all duplications here because uh that saves memory uh and it's not needed and I also ignore uh commands uh which start with a space so that's sometimes quite helpful if you have a command which includes a password then you can start with typing a space at the beginning and then your password stuff and then it's not safe to my history file as the next setting I am configuring some aliases here they're not very interesting so I'll just skip them um but another cool thing is now the plugin sourcing so there are a bunch bunch of plugins which you can use in your zshell configurations and I found my plugins um just watching other YouTube videos uh talking to friends and colleagues and see what they use and also just by browsing through different uh dot files repositories so if you're looking for very cool plugins I really recommend and just taking your time and just search for uh dot files in GitHub and just go through all of them and have a look at the plugins people use So currently I have five plugins which I um mostly use and I have to say they make my life in the Shell quite easy so let's head over to the plugins directory so now we have uh six plugins here listed so the first one I really like to use is fast syntax hiding highlighting and as you can see my um shell output here is in my opinion quite well colored so fast syntax highlighting for example looks like uh this I have a command now and I'm starting to type and as you can see the C is red so that means the shell is not able to recognize this command because when I'm now hitting enter it's saying command not found C but if I extend the C to C A then you can see it change to uh green so that means um I'm able to use the command and this sometimes helps me to quickly realize okay this is a command my shell is aware of and this is a command my shell is not aware of so yeah quite nice to have and there are also different theme options for that um but I just Ed the default here so the next one is really really interesting and nice which is called fzf which stands for fuzzy find this is a plugin which you can use to for example which I mainly use it for is to search through my um shell history of commands so there's the hotkey which you might know which is controlr which which is a reverse lookup of your shell history and in the basic configuration this one is called quite simple and um yeah not very intuitive to find but if I now type um Docker and press controlr then fzf uses that input to go through my history file and browses and shows me all commands which have Docker in that and I can also extend that with Docker compose here for example and uh yeah then I can use my error keys to scroll through my history here which is quite nice and yeah this helps me to um use just commands more often without typing them all the time just a shortcut and it makes my life so much easier so I really recommend using that fzf is also way much more than just the reverse lookup you can use that in directories in um yeah some search quaries where you pipe the output into fzf and then you can search that from there on and open the file out of fzf so this is a very complex tool but I use it for a very simple uh case and that's also the reason why I try to store all my commands in the big history file because that makes fzf able to search through all of them so the next plugin I sometimes use but not very often uh is called goto go to is basically a tool which yeah does what it say so go to and then you can enter short name for something you configured uh I configured here def so go to def means go to the git directory uh I created sometimes I use it but sometimes I don't so I'm thinking of removing that one uh to get rid of it but yeah just that you know so the next cool plugin I really like to use is the abbreviations plugin so you might have heard of aliases and um aliases are yeah just for example um I used to have this Alias which is called GST which stands for get status but abbreviations they uh do extend to the real command which the Alias is for so if I type GST which in my case stands for good status and now I press enter Then This command expands to its real command uh this is quite helpful because you don't forget what the Alias is really for and uh I really like to use abbreviation way more than aliases so maybe you can start using them instead of aliases so another cool plugin is the auto suggestion plugin uh the other suggestion plugin basically shows your last command um when you start typing and for example I just type Docker and you can see the last Docker command I used was the docker run minus minus RM blah blah blah and now I can just either use that full command with just typing the right right error key or um I use the option key and then use the right error key and then I can um yeah start from the left and expand it to the right so maybe I just want to use it up till that point and then I can yeah start typing something different so othero suggestions will help you to uh use the same commands over for a longer time um pretty useful in my opinion uh I really like to use it and the last one is also very nice some people might know the tool J which uh I guess stands for jump I switched at some point to the Z I don't know why but um I think I I like Z more because it's very uh it's more handy on the on the keyboard for me and um that helps you to uh jump to different directories which you use quite often so what that does it weights your usage of directories in a list and when you type in for example Z git then it's choosing the directory in which git um is in the path and which directory is mostly used over a period of time yeah and that's quite helpful because uh I hate typing the CD and then going back to the home directory and from there going to downloads um yeah way better to just use that for example documents and then I can use tab to autocomplete that so yeah pretty nice plugin which makes my life also way easier so to jump back to my Z shell configuration file here um in line 18 um I sourced the plugins. zshell file and in the plugins. zshell file I only have all my Z shell uh plugins listed to load at startup and uh yeah then the next lines are just for my gbg agent uh some settings here for my python environment uh that it's loaded and some local binaries are added to my path so I can use them and also the sdkman which I use for installing my Java runtimes and at the bottom um as you can see in line 37 I use uh Starship in it. zshell and with that command my terminal is styled with My Starship configurations I really recommend doing your research on your uh shell environment so you know saw mine and I really like that it's a quite colorful output and has different functionalities like the abbreviation stuff and the expanding the command and changing to different directories with a shortcut and stuff like that so watch different videos uh have a look at my DOT file repository and uh I think on the top right there is there are some key tags linked and uh you can click on the dot files for example and then other dot files repositories are shown to you so do your research yeah let me know in the comments if you're already configuring your um terminal setup and if not yeah it's time to start now and yeah have a better life in the console see you guys in the next one bye-bye
Info
Channel: Tech with Marco
Views: 11,043
Rating: undefined out of 5
Keywords: tech with marco, starship, zsh, console terminal customization, console terminal, oh my zsh, bash, starship prompt, zsh plugins, terminal theme, linux, mac, tabby, terminal application, bash terminal theme, shell theme, fzf, zsh-z, zsh-autosuggestions, brew, zsh-syntax-highlighting, fast-syntax-highlighting, plugin manager, shell plugin manager, zsh plugin manager, tabby terminal, terminal application mac, beautiful design, beatiful shell, beatiful zsh theme, vim, dotfiles, abbreviations
Id: Wh8yjTWeWQU
Channel Id: undefined
Length: 20min 14sec (1214 seconds)
Published: Sun Oct 01 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.