Customize Your ZSH Prompt with Powerlevel10k

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i've been asked a couple of times how i get my prompt to look like i do so that's what i'm going to look at today this tutorial if you want to call the tutorial uh assumes you're using zsh as your main shell bash is completely different in terms of how you customize your shell you could get to a prompt like mine in bash or fish you just have to go about doing it in a different way so today i'm going to be using zsh and a plug-in as zsh plug-in called power level 10 000. so let's go ahead and jump in so the end result will look something like this it's not the exact prompt that i had but it'll look something like this and like i said in order for us to do this we're going to be using power level 10 000 now if you're using a plug-in manager like oh my zsh this is very easy to install if you're managing your own plug-ins or using some other plug-in system power level 10000 actually has installation for pretty much all those calling presto zim antibody antigen z plug g zone all this stuff you can also do it manually if you wanted to do it manually i'm going to be using my zsh because that's what i prefer to use now i know there are uh shell purists out there who say oh my goodness why are you using my zsh it's such a memory hog or such a waste of space or yadda yadda i don't care i use all my zsh i like all my zsh and i don't give a crap what anybody else says so i i use on my zsh if there's a performance benefit to not using on my zsh i'm not so perceptive to that speed change that i'd even noticed so i do use on my zsh that's just the way i'm going to do this the way you install it then is just clicking on this and it's just a matter of get cloning and then setting the zsh theme in your zshrc file to this right here so i've already had go ahead gone ahead and done this so i'm not going to show you how to do it it's really easy just copy this and it will go through and clone that git repository and then copy this part right here and put this in your zshrc and i will show you my zshrc once we're done setting up power level 10 000. but once you've installed this close your terminal and restart your terminal and you'll get something like this now here's where we get into a little bit of a dependency thing in order for this to work you have to have some kind of font on there that will allow you to see symbols and stuff so fo awesome any of the nerd font completes any of those kind of things those will work fine power line fonts is the one that i'm is the name i'm looking for so any of those kind of fonts now i'm using hack nerd font i believe uh i'm actually not sure it might i might have changed it but i actually i'm using jetbrains i'm using jetbrains in their font so any of the nerd fonts will work uh the powerline fonts will work as well so but you have to have one of those installed and they have to be set in your terminal as your default font otherwise this will not work all right well i mean it will work but you won't get any symbols so basically this is just a wizard you just go through and answer the questions so if you see a diamond here hit yes if you see a lock here hit yes if you see a debian logo here hit yes now here's one where if you see these things and any of them are overlapping which they're not in this case you hit no or i'm gonna hit no i might yes excuse me yes normally in like alacrity and termite i'm always seeing them overlapping this part of the wizard so this is actually a first for me and this is kitty by the way i'm using kitty so we'll hit yes and then here's where you choose how your font you how your prompt will look uh or this is where the beginning of that process so you can choose any number of you know how it will look and i'm going to hit three for rainbow so it's multicolored and this gets colors from your terminal theme but you can also change them manually later so uh if you want the arrows and stuff you choose number one if not you just choose number two i'm gonna hit one and then if it asks you if you want the date and time as part of the second part of the font the prompt i'm going to hit 3 for 12 hour because 24 hours is hard to actually know what it is because i'm stupid that way and then this we want the separator to be uh rounded for me i'm gonna do so i'm gonna do four and we want four here again now you can choose any of these you want but i'm just showing you how i get mine so it's four and i also want five here i want this rounded as well okay and then we want it to be on one line and we want it to be sparse not compact i don't want to be bunched together like that and then i want the icons to show up just fine so we're going to do two and we want to be concise not fluent okay and then we do want the get pulled branch and stuff to show up so we hit yes and if you in this step here i know i'm going fast but in this step here if you have a program that runs every time you run your terminal so whether that's neofetch i use fm6000 a lot of people have dts color scripts or whatever if you have something like that you want to hit number three on this if you don't have an application that runs every time you use your terminal you can hit one so i'm gonna hit three in this case if you hit the wrong one of those you can always rerun this wizard uh by running a command it's in the documentation uh chances are if you hit the wrong one of those and you have an application that runs at startup you'll get an error every time you start up your your terminal so make sure you choose the right one so now we've gone through and we have the prompt that i originally had now the difference is this is using i don't know if you can see this or not but you can see that this just has tux here as the icon and i want to use a custom icon so you can do that by editing the configuration file so the configuration file for p10k is in the file.p10k so we're going to vim into dot p 10k dot zsh that's the file we want to get into and in here you can change pretty much everything about your prompt that you want so basically this is just something that is generated by the wizard by all those settings that we just went through but if you want to go through manually change any of these you could and the documentation or the comments in here is actually really good so what we're going to be looking for is the icon that it uses for that beginning part of the prompt so also here while before i go that you can actually go through and edit what appears in your prompt here right here and that will show you what's on the left and the right side of the prompt and you can just comment out things that you don't want or add things that you do want okay and there's also a several of these that are already commented out but you can you could go ahead and uncomment those if you wanted as well so let me go ahead and scroll down here a little bit and see if i can find that uh icon that i want to change okay so the icon that i want to change is right here so i want to uncomment this and then i want to change this here so in order to do that i need to go find the arch icon in which case i need to go to the nerd fonts cheat sheet so nerd fonts cheat sheet good old google is the easiest way to get there we'll just type in arch and this is the one we want so we copy the icon go back to here let's change this into this and write quit and quit this and open this back up and we have arch and that's how you get my prompt for zsh it's really very very easy i will leave a link down below to power level 10 000 along with the nerd fonts because like i said you will need some kind of font like nerd fonts in order to get this to work other than that it's very simple like i said now is this something that you absolutely need no uh for the most part this is completely useless it's just eye candy that's all it is and like i said you can do this with bash you can do this with fish it just differs and you have to do it basically manually i actually think there is a like a oh my fish or whatever that will do this for fish for bash i'm not sure if there's anything out there like that you know that will do this automatically honestly i haven't used bashing ages like the actual bash prompt i've always just switched to csh so my lack of knowledge there is preventing me from telling you whether or not you could do this outside of doing it manually but you can do this manually to some extent i don't know how close you'd actually come but i know that there is ways to put icons and stuff in your bash prompt so that is it for me today if you want to follow me you can do so at the linuxcash you can also support me on patreon at patreon.com linuxcast before i go i'd like to take a moment to thank my current patrons devon marcus meglin donnie sven east coast web merrick camp and mitchell thanks everybody for watching i'll see you next time you
Info
Channel: The Linux Cast
Views: 53,874
Rating: undefined out of 5
Keywords: linux, open source, apps, zsh prompt, how to use zsh, how to use zsh on linux, how to customize zsh, how to use powerlevel10k, powerlevel10k, how to make your bash prompt look pretty, linux tutorial, linux tutorial for beginners, linux for beginners
Id: oR8v9uOCq0E
Channel Id: undefined
Length: 10min 4sec (604 seconds)
Published: Thu Jun 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.