[#]: subject: "oh my zsh and powerlevel10k: A Match Made in Heaven" [#]: via: "https://www.debugpoint.com/oh-my-zsh-powerlevel10k/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lkxed" [#]: translator: " " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " oh my zsh and powerlevel10k: A Match Made in Heaven ====== **A quick and simple guide to transforming your zsh terminal shell with oh my zsh and powerlevel10k theme to make it look cool in Ubuntu and other Linux distros.** ![][1] The default shell in most of the Linux distributions is bash. Bash is solid and a legacy utility. However, it lacks some customizations, such as nice colours, cursor support, etc. You can use another shell, zsh to enjoy additional tweaks and help you to extend your Bash shell experience. This crisp guide explains how to install zsh, oh my zsh and apply the powerlevel10k theme. ### oh my zsh and powerlevel10k: Installation and configuration guide #### 1. Installing zsh and changing the shell Open a terminal and install zsh using the following command applicable to your distribution. **_Ubuntu, Debian, Linux Mint and all related distro_** ``` sudo apt install zsh ``` _**Fedora**_ ``` sudo dnf install zsh ``` **_Arch_** ``` pacman -S zsh ``` After installation is complete, find out the zsh install path ``` whereis zsh ``` Then change the shell using the zsh executable path for the current user. ``` chsh -s /usr/bin/zsh ``` ![change the shell for the current user][2] Close and open the terminal again. And you should see the first-time setup for zsh. Select option 2. And it will change the look of your shell prompt with a default theme, as shown below. ![first time setup for zsh][3] #### 2. Install oh my zsh The oh my zsh is a set of scripts to customize zsh further. Firstly, we will install oh my zsh script by downloading it from GitHub. It would be best if you had wget and git package for that. [Install wget][4] & git using the following command if it’s not installed. ``` sudo apt install wget sudo apt install git ``` Then install oh my zsh using the following command. ``` sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ``` And you should see the oh my zsh theme is applied with a default theme robbyrussell to your terminal. ![Install oh my zsh and default theme][5] The Oh my zsh also comes with additional themes, and you can install them [using this guide][6]. However, in this tutorial, I will talk about a specific theme, i.e. powerlevel10k. #### 3. Install powerlevel10k theme for oh my zsh Open a terminal and run the following command to clone powerlevel10k repo from GitHub and put the files in the config folder of oh my zsh. ``` git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k ``` Open the `~/.zshrc` file in a text editor and set the `ZSH_THEME` variable to `"powerlevel10k/powerlevel10k"`. ``` cd ~ ``` ``` nano .zshrc ``` By default, it should be robbyrussell. Remove “robbyrussell” and add the below `"powerlevel10k/powerlevel10k"`. Your `~/.zshrc` file should look something like this after the change: `ZSH_THEME="powerlevel10k/powerlevel10k"` Save and close the file (CTRL+O, ENTER and CTRL+X). ![change oh my zsh theme to powerlevel10k][7] Restart your terminal to launch the first-time wizard to set up the powerlevel10k theme. #### 4. First time set up for powerleve10k When you launch the terminal after the installation, the powerlevel10k prompts you with various questions to understand your Linux distro setup. So, press the key as per your need to customize your terminal as per your taste. Some example screenshots of questions are below to give you some idea. ![powerlevel10k - wizard1][8] ![powerlevel10k - wizard 2][9] And finally, you can save the file to enjoy the new look of your terminal. ![After applying settings in powerlevel10k zsh theme][10] If you want to restart the configuration wizard again, run the following. You can do it as many times as you want. ``` p10k configure ``` This concludes the basic setup. If you want more, follow along. ### More configuration (advanced usage) #### 5. Installing dracula GNOME Terminal theme If you are using GNOME desktop with the native terminal, you can try the stunning drakula theme. To do that, open a terminal and run the following command to download the theme. ``` git clone https://github.com/dracula/gnome-terminalcd gnome-terminal ``` Open GNOME Terminal and go to preferences. Add a new profile by clicking on the [+] and name it “drakula”. Then go to colours tab and uncheck ‘use colors from system theme’ option. ![create a new profile for terminal][11] Go back to the terminal and run the following. When prompted, select the profile name which you just created as above. ``` ./install.sh ``` ![applying the drakula theme for gnome terminal][12] Once the installation is complete, go back to preferences and mark the drakula profile as default. #### 6. Autocomplete and syntax highlighting for zsh There are two community-developed plugins available for zsh, which you may want to try out. They are zsh-autosuggestions and zsh-syntax-highlighting. Open a terminal and run the following to download zsh-autosuggestions and put it inside the plugin folder. ``` git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions ``` Similarly, run the following for the syntax highlighting plugin. ``` git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting ``` Open the ~/.zshrc file via a text editor (use the following command), and find the plugins=(git) line. And replace it with the following: ``` nano ~/.zshrc ``` ``` plugins=(git zsh-autosuggestions zsh-syntax-highlighting) ``` Save & close the file using CTRL+O, ENTER and CTRL+X. Close and open your terminal; now, you should be able to use the auto-suggestions and syntax highlighting. ### Wrapping Up That’s it! You should now have “Oh My Zsh” and the Powerlevel10k theme installed on your system. You can customize the appearance and behaviour of the Powerlevel10k theme by customizing further as per your need. Cheers. -------------------------------------------------------------------------------- via: https://www.debugpoint.com/oh-my-zsh-powerlevel10k/ 作者:[Arindam][a] 选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.debugpoint.com/author/admin1/ [b]: https://github.com/lkxed [1]: https://www.debugpoint.com/wp-content/uploads/2022/12/ohp10k.jpg [2]: https://www.debugpoint.com/wp-content/uploads/2022/12/change-the-shell-for-the-current-user.jpg [3]: https://www.debugpoint.com/wp-content/uploads/2022/12/first-time-setup-for-zsh.jpg [4]: https://www.debugpoint.com/wget-not-found-error/ [5]: https://www.debugpoint.com/wp-content/uploads/2022/12/Install-oh-my-zsh-and-default-theme.jpg [6]: https://www.debugpoint.com/install-use-zsh/ [7]: https://www.debugpoint.com/wp-content/uploads/2022/12/change-oh-my-zsh-theme-to-powerlevel10k.jpg [8]: https://www.debugpoint.com/wp-content/uploads/2022/12/powerlevel10k-wizard1.jpg [9]: https://www.debugpoint.com/wp-content/uploads/2022/12/powerlevel10k-wizard-2.jpg [10]: https://www.debugpoint.com/wp-content/uploads/2022/12/After-applying-settings-in-powerlevel10k-zsh-theme.jpg [11]: https://www.debugpoint.com/wp-content/uploads/2022/12/create-a-new-profile-for-terminal.jpg [12]: https://www.debugpoint.com/wp-content/uploads/2022/12/applying-the-drakula-theme-for-gnome-terminal.jpg