Update the colour theme for the Terminal.app, and more...

Update the colour theme for the Terminal.app, and more...

active terminal commands

Colour Theme

Well, I choose Dracula theme (a dark theme) for my Terminal.app. There are many more themes available in the lysyi3m/macos-terminal-themes repository. All the installation steps are the same, so just choose the right one suits for you.

Here are the steps to install the Dracula colour theme for Terminal.app:

  1. Download the Dracula File, unzip it.
  2. Now in Terminal.app, open Preferences…, and switch to Profiles tab.
  3. Click the Gear icon (⚙︎) at the bottom-left corner.
  4. Click Import…
  5. Select the Dracula.terminal file in the folder you just downloaded.
  6. Focus on the Dracula theme then click Default to make this colour theme default. Then restart the Terminal.app.

For my VS Code, using the same Dracula theme, just fine…

Zsh

Zsh is a shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of bash, ksh, and tcsh were incorporated into zsh; many original features were added.

😎 It seems that on macOS BigSur, the default shell application is zsh now… So, you don’t need to manually install zsh anymore.

Install it via brew:

brew install zsh

Then change the default shell to zsh rather than bash (the default on Mac OSX), run the following command in terminal:

chsh -s /bin/zsh

Install zsh-syntax-highlighting for colouring commands when typing in terminal:

brew install zsh-syntax-highlighting

Many other plugins could found at zsh-users. And enable it in the .zshrc file:

cd ~
touch .zshrc
echo 'source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh' >> ~/.zshrc

Nerd Fonts

Nerd Fonts is a project that patches developer targeted fonts with a high number of glyphs (icons). Specifically to add a high number of extra glyphs from popular ‘iconic fonts’ such as Font Awesome ➶, Devicons ➶, Octicons ➶, and others.

This font includes lots of icons, which makes the terminal more interactive.

Icons included in Nerd fonts

Since I also need Fira Code, I chose to install the font-firacode-nerd-font:

brew cask install font-firacode-nerd-font

Next, enable this font in Terminal.app:

Preferences > Profiles > Text > Font > Change... > FuraCode Nerd Font

Don’t be surprised by the name of the font in the options, it’s a RFN (Reserved Font Name) for Fira Code Nerd Font.

If you’re also use VS Code, don’t forget to update the font settings for terminal in VS Code to make Nerd Fonts working.

Currently, I’m using “Operator Mono” fonts, a patched version can be downloaded here.

Powerlevel9k

I’m switching to powerlevel10k, see next section below for configurations.

There are many themes for zsh, one of my favourites is powerlevel9k, follow the steps to install it:

echo "POWERLEVEL9K_MODE='nerdfont-complete'" >> ~/.zshrc
git clone https://github.com/bhilburn/powerlevel9k.git ~/.powerlevel9k
echo 'source  ~/.powerlevel9k/powerlevel9k.zsh-theme' >> ~/.zshrc

Notice that I used a hidden folder .powerlevel9k for storing the files. Also, the font needs to be set before powerlevel9k is initialised in the ~/.zshrc.

Powerlevel9k is highly configurable. To change your setup, open your ~/.zshrc and add in the configuration you prefer. Here is what I used in my ~/.zshrc:

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
POWERLEVEL9K_MODE='nerdfont-complete'
source ~/.powerlevel9k/powerlevel9k.zsh-theme
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(ssh dir vcs newline status)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true

There is even a Show Off Your Config page, you can find other developer’s custom configurations for powerlevel9k. These configurations also affect the appearance of terminal inside VS Code.

Powerlevel10k

The appearance of powerlevel10k is similar to 9k, but it’s much easier to configure.

Manually install it:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/.powerlevel10k
echo 'source ~/.powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc
source ~/.zshrc

This is the simplest kind of installation. It will prompt you the steps to configure the styles.

You can re-config powerlevel10k at anytime if you’re not satisfied by the previous applied styles via:

p10k configure

Well, that’s all for my current configurations in Terminal.app, enjoy it and happing coding…

THE END
Ads by Google

林宏

Frank Lin

Hey, there! This is Frank Lin (@flinhong), one of the 1.41 billion . This 'inDev. Journal' site holds the exploration of my quirky thoughts and random adventures through life. Hope you enjoy reading and perusing my posts.

YOU MAY ALSO LIKE

Setup an IKEv2 server with strongSwan

Tutorials

2020.01.09

Setup an IKEv2 server with strongSwan

IKEv2, or Internet Key Exchange v2, is a protocol that allows for direct IPSec tunnelling between networks. It is developed by Microsoft and Cisco (primarily) for mobile users, and introduced as an updated version of IKEv1 in 2005. The IKEv2 MOBIKE (Mobility and Multihoming) protocol allows the client to main secure connection despite network switches, such as when leaving a WiFi area for a mobile data area. IKEv2 works on most platforms, and natively supported on some platforms (OS X 10.11+, iOS 9.1+, and Windows 10) with no additional applications necessary.

TOC

Ads by Google