ZSH, Fonts and a Beautiful Terminal
Tags: terminal, apple, zsh
Published: 2022-03-09 16:26:09

Let's focus on our primary source of information in the development world—the terminal.

I know most of you may want to use newer applications to handle terminal operations like iTerm2 or others. Still, personally, the built-in terminal application can take a lot and can be a potent application.

## Fonts
The first step is to install the basic fonts needed in our terminal.

```bash
# Nerd Fonts
brew tap homebrew/cask-fonts
brew install font-hack-nerd-font
```

- Copy Fonts

> If you cloned or forked the [repository](https://github.com/bloodf/mac.environment) you can execute the following command

```bash
cp -r "$(pwd)/fonts/"* ~/Library/Fonts
```

## ZSH

The [oh my Zsh](https://ohmyz.sh/) project is a good terminal add-on to be added in our development environment. 

- Install

```bash
# Oh My ZSH
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
```

- Set the configuration file

> If you cloned or forked the [repository](https://github.com/bloodf/mac.environment) you can execute the following command

```bash
ln -s $(pwd)/zsh/zshrc ~/.zshrc
```

### Plugins
Here are some plugins that can be used alognside with Oh My Zsh, and make your experience much better.

> If you cloned or forked the [repository](https://github.com/bloodf/mac.environment) and used the configuration file, those plugins are required.

- zsh-autosuggestions

```bash
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
```

- zsh-syntax-highlighting

```bash
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
```

- zsh-async

```bash
git clone https://github.com/mafredri/zsh-async ~/.oh-my-zsh/plugins/async
```

- zsh-nvm

```bash
git clone https://github.com/lukechilds/zsh-nvm ~/.oh-my-zsh/custom/plugins/zsh-nvm
```

- powerlevel10k

```bash
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k
```

> If you cloned or forked the [repository](https://github.com/bloodf/mac.environment) you can execute the following command
```bash
ln -s $(pwd)/zsh/p10k ~/.p10k.zsh
```

---

> These steps are available only for those who cloned or forked the [repository](https://github.com/bloodf/mac.environment)

## Terminal
To add some new configurations and special tools to the terminal, you can execute the following command to import those.

- Set the configuration file

```bash
ln -s $(pwd)/bash/bash_alias ~/.bash_alias
ln -s $(pwd)/bash/bash_profile ~/.bash_profile
ln -s $(pwd)/bash/bashrc ~/.bashrc
ln -s $(pwd)/bash/profile ~/.profile
ln -s $(pwd)/bash/profile ~/.android
ln -s $(pwd)/bash/profile ~/.flutter
ln -s $(pwd)/bash/profile ~/.nvm-load
```

>Attention, because inside the files `.android, .flutter, .nvm-load` there are specific configurations, with version based, please edit the file with the appropriate version before loading those.

### Theme
You can change the Mac Terminal application appearance with some quick steps.

1. Terminal > Settings Tab
2. Click "Gear" icon
3. Click Import...
4. Select the `materialshell-dark.terminal` file
5. Click Default

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77pu4602w1cusup0rlj1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfk6ihhzv4nabghz4z51.png)