My Ubuntu/MacOS Terminal Setup
The default Ubuntu Terminal app is not that great (and probably the macOS’ one is even worse). But it does take minimal effort to set up a few basic tools that will help Terminal productivity a lot.
In this guide, you will learn how to set up a similar configuration.
- This is not a tutorial on how to use the Terminal, I suppose that you already know the basics.
- You also need a working Linux system.
- Most steps are almost identical if you are on macOS.
- Finally, you need Git to install the powerlevel10k theme and some Zsh plugins.
# Zsh Setup
You can skip this step if you are on macOS 10.15 (Catalina) or above: Zsh is already the default shell.
Zsh is a shell that is built on top of Bash, the default Ubuntu shell. For most purposes, what you can do in Bash you can do also in Zsh.
Use the following commands to install Zsh.
Once Zsh is installed, you need to set it as the default shell. While there is a command to change the login shell,
gnome-terminal will still default to use Bash1.
You can force it to use the new shell following these steps:
- Open a new Terminal window (
ctrl + alt + T)
- Click on
Terminal > Preferenceson the top left side of the screen.
defaultto modify the default profile.
- Navigate to the
- Check both boxes
- Run command as a login shell
- Run a custom command instead of the login shell
zshin the Custom command text box
- Set the When command exits dropdown menu to
Exit the terminal
- Close the preferences and the Terminal window.
Next time you will open the tab, Zsh will be used instead of Bash. From now on, shell configurations (aliases, etc.) should be added to the
# Setup Oh-My-Zsh
Oh-My-Zsh is an open-source framework to manage the Zsh configuration. Briefly, it makes it easier to customize the shell configuration and install plugins.
Installation is quick: you need to paste a command into your Terminal. Reference the documentation to know which command you must use.
.zshrcfile provided by Oh-My-Zsh is very well commented and can offer details in case you get stuck during some customization.
# Install powerlevel10k Theme
powerlevel10k is a theme for the Zsh shell: good customization, with tons of features that will help you when using git or other tools. It is also very fast.
Also in this case, installation is really quick, you only need to clone a git repo. Check the documentation to know the exact command for Oh-My-Zsh users.
Once you cloned the repo, do the following:
- Open a new Terminal window.
- Open the
.zshrcfile (for example with
- Set the
- Close the editor (
ctrl + Xand
Yin case of
Once you reopen the Terminal app, the theme configuration will take place. Follow the instructions and choose the settings you prefer.
To change your settings later on, you can trigger the configuration process by typing
# Installing Plugins
There is a plethora of plugins for the Zsh shell. I like to keep my list small, but you can find the STANDARD plugin list on GitHub.
The STANDARD plugins are the ones already installed with the Oh-My-Zsh framework. To enable them:
- Open the
- Search for the
pluginsvariable (near the end of the file).
- Add the list of plugins you want to use between parentheses, separated by a single space. In my case, I have
There are also some other plugins, developed and supported by the community. To use them
- Clone the plugin GitHub repo into
- Add the repo name to the
pluginsvariable like with standard plugins.
I like to use the following plugins:
- zsh-syntax-highlighting → fish-shell like syntax highlighting
- zsh-completion → improve shell auto-completion
- zsh-autosuggestions → improve auto-completion based on shell history
In the end, my
plugins variable is
If you followed the complete tutorial, you should have a very fast and visually pleasing Terminal, with auto-completion and syntax highlight. You can go on to customize your setup as you prefer.