Skip to content

Custom Unix Terminal

This document serves as a guide for how I customize my terminal in macOS and Linux. It includes a variety of configurations, settings, and programs that I find helpful for my daily workflow. The document is divided into several sections, each focusing on a different aspect of terminal customization.

Useful Programs

The following table contains a list of terminal programs that I find particularly useful. These programs are separated into two categories: Third Party Package Managers (TPPM) and Native Package Managers (NPM).

The TPPM section features programs that can be installed using package managers like Homebrew, Pip, Cargo, Npm, Gem, or Git(1). For each program, I've included a brief description, the operating systems it supports, and the package managers available for installation.

  1. While most of these programs can be installed via git, they will only be marked as such if recommended by the program's documentation or myself, or if it's the only available installation method.

The NPM section lists programs that can be installed using the system's default package manager. Since the primary Debian- and Arch-based Linux based distributions, all the programs in this section are confirmed to be installable via apt or pacman. For other Linux distributions, you can check Repology to see if the program is available in your distribution's package manager. Similar to the TPPM section, I've included additional information such as a brief description for each program and a link to its Repology page.

Programs Description Applicable OS's Available Package Managers Is a Command Other Info
.tmux Oh my tmux! My self-contained, pretty & versatile tmux configuration made with. macOS
Linux
Github No Requires tmux to be installed.
bandwhich Terminal bandwidth utilization tool. macOS
Linux
homebrew version
Crates.io
Yes
bat A cat(1) clone with wings. macOS
Linux
homebrew version
Crates.io
Yes
black The uncompromising Python code formatter. macOS
Linux
homebrew version
PyPI
Yes
cheat Cheat allows you to create and view interactive cheatsheets on the command-line. macOS
Linux
homebrew version Yes
codespell Check code for common misspellings. macOS
Linux
homebrew version
PyPI
Yes
coreutils These are the GNU core utilities. This package is the union of the GNU fileutils, sh-utils, and textutils packages. macOS homebrew version Collection All GNU commands installed via coreutils, are the same as they are on Linux, but prefixed with a g (i.e. gcp for cp).
duf Disk Usage/Free Utility - a better 'df' alternative. macOS
Linux
homebrew version Yes
eza A modern, maintained replacement for ls. macOS
Linux
homebrew version
Crates.io
Yes
ffmpeg FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata. macOS
Linux
homebrew version Yes
fzf A command-line fuzzy finder. macOS
Linux
homebrew version Yes
fzf-tab Replace zsh's default completion selection menu with fzf! macOS
Linux
homebrew version
Github
No
gallery-dl Command-line program to download image galleries and collections from several image hosting sites. macOS
Linux
homebrew version
PyPI
Yes
git Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. macOS
Linux
homebrew version Yes
git-delta A syntax-highlighting pager for git, diff, and grep output macOS
Linux
homebrew version
Crates.io
No
git-open Type git open to open the GitHub page or website for a repository in your browser. macOS
Linux
homebrew version Yes
git open
gnupg The GNU Privacy Guard macOS
Linux
homebrew version Yes
gpg or gpg2
htop Improved top (interactive process viewer). macOS
Linux
homebrew version Yes
imagemagick Use ImageMagick® to create, edit, compose, or convert digital images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, GIF, WebP, HEIC, SVG, PDF, DPX, EXR and TIFF. macOS
Linux
homebrew version Yes
magick
More info here.
isort A Python utility / library to sort imports. macOS
Linux
homebrew version
PyPI
Yes
lazygit Simple terminal UI for git commands. macOS
Linux
homebrew version Yes
lynis Security and system auditing tool to harden systems. macOS
Linux
homebrew version
Github
Yes Recommended install method: Git.
ncdu ncdu (NCurses Disk Usage) is a curses-based version of the well-known 'du'. macOS
Linux
homebrew version Yes
neovim Vim-fork focused on extensibility and usability. macOS
Linux
homebrew version No
nvim
prettier Code formatter for JavaScript, CSS, JSON, GraphQL, Markdown, YAML. macOS
Linux
homebrew version
npm
Yes
pstree List processes as a tree. macOS
Linux
homebrew version Yes
pipenv Python dependency management tool. macOS
Linux
homebrew version
PyPI
Yes
pipx Install and Run Python Applications in Isolated Environments. macOS
Linux
homebrew version
PyPI
Yes
pyenv Simple Python version management. macOS
Linux
homebrew version Yes
pylint It's not just a linter that annoys you! macOS
Linux
homebrew version
PyPI
Yes
shellcheck Shell script analysis tool. macOS
Linux
homebrew version Yes
shellharden Shellharden is a syntax highlighter and a tool to semi-automate the rewriting of scripts to ShellCheck conformance, mainly focused on quoting. macOS
Linux
homebrew version
Crates.io
Yes
terminal-notifier Send macOS User Notifications from the command-line. macOS
Linux
homebrew version
Gem
No Also see the bgnotify plugin.
tmux tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. macOS
Linux
homebrew version
trash-cli Command line interface to the freedesktop.org trashcan. macOS
Linux
homebrew version
PyPI
Collection
tree Display directories as trees (with optional color/HTML output). macOS
Linux
homebrew version Yes
tree-sitter Tree-sitter is a parser generator tool and an incremental parsing library. macOS
Linux
homebrew version
Crates.io
No
wget Wget is a free utility for non-interactive download of files from the Web. macOS
Linux
homebrew version Yes
yt-dlp A feature-rich command-line audio/video downloader. macOS
Linux
homebrew version
PyPI
Yes
zip Compression and file packaging/archive utility. macOS
Linux
homebrew version Yes
zsh UNIX shell (command interpreter). macOS
Linux
homebrew version No
zsh-autosuggestions Fish-like autosuggestions for zsh. macOS
Linux
homebrew version
Github
No Zsh must be installed.
Install instructions.
zsh-completions Additional completion definitions for Zsh. macOS
Linux
homebrew version
Github
No Zsh must be installed.
zsh-syntax-highlighting Fish shell like syntax highlighting for Zsh. macOS
Linux
homebrew version
Github
No Zsh must be installed.
Install instructions.

Applicable Operating Systems: Linux

Programs Description Number of Repository Families Featuring this Package Is a Command Other Info
apt-listchanges Package change history notification tool. Packaging status Yes Specific to Debian based distributions.
Rarely used as a command.
bandwhich Terminal bandwidth utilization tool. Packaging status Yes
bat-cat A cat(1) clone with wings. Packaging status Yes
bat or batcat or bat-cat
black The uncompromising Python code formatter. Packaging status Yes Recommended install method: Homebrew OR Pip.
codespell Check code for common misspellings. Packaging status Yes
deborphan Program that can find unused packages, e.g. libraries. Packaging status Yes Specific to Debian based distributions.
duf Disk Usage/Free Utility - a better 'df' alternative. Packaging status Yes
eza A modern, maintained replacement for ls. Packaging status Yes For the apt package installation, see here.
ffmpeg FFmpeg is a collection of libraries and tools to process multimedia content such as audio, video, subtitles and related metadata. Packaging status ???
fzf A command-line fuzzy finder. Packaging status Yes Recommended install method: Git OR Oh My Zsh
gallery-dl Command-line program to download image galleries and collections from several image hosting sites. Packaging status Yes
git Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. Packaging status Yes
git-delta A syntax-highlighting pager for git, diff, and grep output Packaging status No
gnupg The GNU Privacy Guard Packaging status Yes
gpg or gpg2
htop A cross-platform interactive process viewer. Packaging status Yes
imagemagick Use ImageMagick® to create, edit, compose, or convert digital images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, GIF, WebP, HEIC, SVG, PDF, DPX, EXR and TIFF. Packaging status Yes
magick

More info here.
Recommended install method: Homebrew.
lazygit Simple terminal UI for git commands. Packaging status Yes
lynis Security and system auditing tool to harden systems. Packaging status Yes Recommended install method: Git.
ncdu ncdu (NCurses Disk Usage) is a curses-based version of the well-known 'du'. Packaging status Yes
neovim Vim-fork focused on extensibility and usability. Packaging status Yes
nvim
pstree List processes as a tree. Packaging status Yes
pipenv Python dependency management tool. Packaging status Yes
pipx Install and Run Python Applications in Isolated Environments. Packaging status Yes Recommended install method: Homebrew OR Pip.
python-is-python3 symlinks /usr/bin/python to python3. nan No
shellcheck Shell script analysis tool. Packaging status Yes
tmux tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. Packaging status Yes
trash-cli Command line interface to the freedesktop.org trashcan. Packaging status Collection Recommended install method: Homebrew OR Pip.
tree Display directories as trees (with optional color/HTML output). nan Yes
yt-dlp A feature-rich command-line audio/video downloader. Packaging status Yes
zip Compression and file packaging/archive utility. Packaging status Yes
zsh UNIX shell (command interpreter). Packaging status No
zsh-autosuggestions Fish-like autosuggestions for zsh. Packaging status No Not a command.
Zsh must be installed.
Recommended install method: Git.
zsh-completions Additional completion definitions for Zsh. Packaging status No Not a command.
Zsh must be installed.
Recommended install method: Git.
zsh-syntax-highlighting Fish shell like syntax highlighting for Zsh. Packaging status No Not a command.
Zsh must be installed.
Recommended install method: Git.

Customizing ZSH

Framework

Oh-my-zsh is my preferred framework due to its popularity, reliability, and consistent updates. As one of the leading zsh frameworks, it made its initial commit on August 23, 2009, allowing it enough time to develop and refine its features.

Below is a list of oh-my-zsh plugins that I use and find to provide useful functionality.

Shell Theme

In combination with oh-my-zsh, I use Starship as my shell theme. Starship is a fast, minimal, and highly customizable shell prompt that displays information about the current directory, git branch, and other relevant details. It is written in Rust, making it very fast and lightweight.

As a note, I previously used Powerlevel10k, which is another excellent shell theme. However, as of May 21, 2024, Powerlevel10k has entered a "life support" mode. In the maintainer's words, "The project has very limited support", with "no new features are in the works", "most bugs will go unfixed", and "help requests will be ignored". As such, I decided to switch to an actively maintained project and mature alternative, Starship.

ZSH Resource File

Below are the configurations for my .zshrc file, divided into two sections: one for macOS and one for Linux. Each section is tailored to its respective operating system.

You're welcome to use this resource however you like. My intention is to offer it as a guide for structuring your own .zshrc file and to present additional configurations not detailed elsewhere in this document.

My ZSH Resource File
.zshrc
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#ZSH_THEME=""

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Disable audo updates for ohmyzsh. This is taken care of by chezmoi.
DISABLE_AUTO_UPDATE="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS="yyyy-mm-dd"

# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
# MAYBE: Add `command-not-found` plugin.
plugins=(colored-man-pages copybuffer copypath copyfile bgnotify)

# Zsh "plugin" installed via git and the following command:
# git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
zsh_completion="${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src"
[[ -d $zsh_completion ]] && fpath+=${zsh_completion}

source "$ZSH/oh-my-zsh.sh"


####[ Personal Configurations ]#########################################################
####[[ Aliases ]]#######################################################################


###
### [ Group 1 ]
###

## General aliases.
alias ic="cd ~/Library/Mobile\ Documents/com~apple~CloudDocs"
alias edisk="cd /Volumes && ll"
alias zls="eza"
alias rmdsstore="find . -name '*.DS_Store' -type f -delete"
alias code="open -a 'Visual Studio Code.app' ."
alias formatc="find . -name '*.cs' -type f -exec clang-format --style='file:$HOME/Programs/Mine/Formatter Configs/CSharp_clang-format/_clang-format' -i {} +"
alias updatebrew="brew update && brew upgrade && brew autoremove && brew cleanup && brew doctor"

###
### [ Group 2 ]
###
### Due to the number of commands that I find to be useful, I've created aliases
### containing some of these commands. They are specifically commands that I don't
### often use, but are useful to have on hand. Having these aliases allows me to see
### a list of these commands, without having to commit them to memeory.
###

alias lt="echo -e \"
####[ Package Manager installed commands ]##############################################

bandwhich - Terminal bandwidth utilization tool.
bat       - A cat(1) clone with wings.
codespell - Check code for common misspellings.
duf       - Disk Usage/Free Utility - a better 'df' alternative.
fzf       - A command-line fuzzy finder.
ncdu      - ncdu (NCurses Disk Usage) is a curses-based version of the well-known 'du'.
pstree    - List processes as a tree.
tmux      - Terminal multiplexer.

####[[ Grouped commands ]]##############################################################

lt_conversion - List of programs used for converting the formats of videos, images, etc.
lt_git        - List of programs used for git related commands.


####[ Keyboard combinations ]###########################################################

Ctrl + O - Allows you to copy what you are currently typing, via 'Ctrl' + 'O'.
\""
alias lt_conversion="echo -e \"
########################################################################################
#### [ Image and video formatters ]

ffmpeg - FFmpeg is a collection of libraries and tools to process multimedia content.
magick - Convert between image formats as well as resize an image, blur, crop,
         despeckle, dither, draw on, flip, join, re-sample, and much more.
\""
alias lt_git="echo -e \"
####[ Git Related Commands ]###########################################################

lazygit  - Simple terminal UI for git commands.
git open - Opens the GitHub page for a repo/branch in your browser.
ugit     - ugit helps you undo git commands without much effort.
\""


####[[ Environmental Variables ]]#######################################################


# 1Password auth socket.
export SSH_AUTH_SOCK="$HOME/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"

# Path purpose:
#   /usr/local/opt/curl/bin:       ...
#   /usr/local/sbin:               ???
#   /usr/local/opt/openjdk@17/bin: Prefered java version.
#   /usr/local/opt/node@18/bin:    Prefered node version.
#   /usr/local/opt/ruby/bin:       Prefered ruby version.
export PATH="/usr/local/opt/curl/bin:/usr/local/sbin:/usr/local/opt/openjdk@17/bin:/usr/local/opt/node@18/bin:/usr/local/opt/ruby/bin:$PATH"

# Modifies the colors of files and directories when using `ls`.
export LSCOLORS="exgxfxDxcxegDaabagacaD"
## Version of LSCOLORS compatible with zsh and GNU based commands.
## You can find more information about LS_COLORS and why it's needed in addition to LSCOLORS,
## here: https://github.com/ohmyzsh/ohmyzsh/issues/6060#issuecomment-327934559
export LS_COLORS="di=34:ln=36:so=35:pi=1;33:ex=32:bd=34;46:cd=1;33;40:su=30;41:sg=30;46:tw=30;42:ow=30;1;43"

## Set default editor.
if hash nvim 2>/dev/null; then
    export EDITOR=nvim
    export VISUAL=$EDITOR
fi

# Node Version Manager (NVM) configurations.
export NVM_DIR="$HOME/.nvm"


####[[ Sourced Files ]]#################################################################


## Load NVM.
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

## Zsh "plugin" installed via git and the following command:
## git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
zsh_syntax_highlighting="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
[[ -f $zsh_syntax_highlighting ]] && source "$zsh_syntax_highlighting"

## Zsh "plugin" installed via git and the following command:
## git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
zsh_autosuggestions="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
[[ -f $zsh_autosuggestions ]] && source "$zsh_autosuggestions"

## Zsh "plugin" installed via git and the following command:
## git clone https://github.com/Aloxaf/fzf-tab ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab
fzf_tab="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab/fzf-tab.plugin.zsh"
[[ -f $fzf_tab ]] && hash fzf 2>/dev/null && source "$fzf_tab"

# Enable the use of '1password-cli' plugins.
source "$HOME/.config/op/plugins.sh"


####[[ Zsh Style Configurations ]]######################################################


# Disable sort when completing `git checkout`.
zstyle ':completion:*:git-checkout:*' sort false
# Set descriptions format to enable group support.
# NOTE: Don't use escape sequences here, fzf-tab will ignore them.
zstyle ':completion:*:descriptions' format '[%d]'
# Set list-colors to enable filename colorizing.
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
## Preview directory's content with `eza` when completing `cd`.
hash eza 2>/dev/null \
    && zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'
# Switch group using `<` and `>`.
zstyle ':fzf-tab:*' switch-group '<' '>'


####[[ End of File Configurations ]]####################################################
#### These are configurations that are specified to be placed at the end of the file, by
#### the developer/documentation.


# Initialize Starship prompt, if it is installed and $ZSH_THEME is not set.
hash starship 2>/dev/null \
    && [[ -z $ZSH_THEME ]] \
    && eval "$(starship init zsh)"


####[[ Others ]]########################################################################
#### These are generally configurations set up by setup scripts or other programs.
.zshrc
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#ZSH_THEME=""

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Disable audo updates for ohmyzsh. This is taken care of by chezmoi.
DISABLE_AUTO_UPDATE="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
HIST_STAMPS="yyyy-mm-dd"

# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
#plugins=(colored-man-pages copybuffer copypath copyfile bgnotify command-not-found)  # Desktop
plugins=(colored-man-pages command-not-found)  # Server

# Zsh "plugin" installed via git and the following command:
# git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions
zsh_completion="${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src"
[[ -d $zsh_completion ]] && fpath+=${zsh_completion}

source "$ZSH/oh-my-zsh.sh"


####[ Personal Configurations ]#########################################################
####[[ Aliases ]]#######################################################################


###
### [ Group 1 ]
###

## General aliases.
alias zls="eza"
alias formatc="find . -name '*.cs' -type f -exec clang-format --style='file:$HOME/Programs/Mine/Formatter Configs/CSharp_clang-format/_clang-format' -i {} +"
hash xdg-open 2>/dev/null && alias open="xdg-open"

## Update based aliases.
alias updateapt="sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt autoclean"
alias updatepacman="sudo pacman -Syu && yay && yay -Yc"

###
### [ Group 2 ]
###
### Due to the number of commands that I find to be useful, I've created aliases
### containing some of these commands. They are specifically commands that I don't
### often use, but are useful to have on hand. Having these aliases allows me to see
### a list of these commands, without having to commit them to memeory.
###

alias lt="echo -e \"
####[ Package Manager installed commands ]##############################################

bandwhich  - Terminal bandwidth utilization tool.
bat        - A cat(1) clone with wings.
cheat      - Allows you to create and view interactive cheatsheets on the command-line.
codespell  - Check code for common misspellings.
duf        - Disk Usage/Free Utility - a better 'df' alternative.
fzf        - A command-line fuzzy finder.
ncdu       - ncdu (NCurses Disk Usage) is a curses-based version of the well-known 'du'.
pstree     - List processes as a tree.
tmux       - Terminal multiplexer.

####[[ Grouped commands ]]##############################################################

lt_conversion - List of programs used for converting the formats of videos, images, etc.
lt_git        - List of programs used for git related commands.


####[ Keyboard combinations ]###########################################################

Ctrl + O - Allows you to copy what you are currently typing, via 'Ctrl' + 'O'.
\""
alias lt_conversion="echo -e \"
########################################################################################
#### [ Image and video formatters ]

ffmpeg - FFmpeg is a collection of libraries and tools to process multimedia content.
magick - Convert between image formats as well as resize an image, blur, crop,
         despeckle, dither, draw on, flip, join, re-sample, and much more.
\""
alias lt_git="echo -e \"
####[ Git Related Commands ]###########################################################

lazygit  - Simple terminal UI for git commands.
git open - Opens the GitHub page for a repo/branch in your browser.
ugit     - ugit helps you undo git commands without much effort.
\""


####[[ Environmental Variables ]]#######################################################


# PATH value...
export PATH="$PATH:$HOME/.local/bin:/opt/nvim-linux64/bin"

# Modifies the colors of files and directories in the terminal.
export LS_COLORS="di=34:ln=36:so=35:pi=1;33:ex=32:bd=34;46:cd=1;33;40:su=30;41:sg=30;46:tw=30;42:ow=30;1;43"

## Set default editor.
if hash nvim 2>/dev/null; then
    export EDITOR=nvim
    export VISUAL=$EDITOR
fi

# Node Version Manager (NVM) configurations.
export NVM_DIR="$HOME/.nvm"


####[[ Sourced Files ]]#################################################################


## Load NVM.
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

## Source the plugins.sh file for the `op` command.
[[ -f $HOME/.config/op/plugins.sh ]] \
    && source "$HOME/.config/op/plugins.sh"

# Zsh "plugin" installed via git and the following command:
# git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
zsh_syntax_highlighting="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
[[ -f $zsh_syntax_highlighting ]] && source "$zsh_syntax_highlighting"

# Zsh "plugin" installed via git and the following command:
# git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
zsh_autosuggestions="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
[[ -f $zsh_autosuggestions ]] && source "$zsh_autosuggestions"

# Zsh "plugin" installed via git and the following command:
# git clone https://github.com/Aloxaf/fzf-tab ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab
fzf_tab="${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab/fzf-tab.plugin.zsh"
[[ -f $fzf_tab ]] && hash fzf 2>/dev/null && source "$fzf_tab"


####[[ Zsh Style Configurations ]]######################################################


# Disable sort when completing `git checkout`.
zstyle ':completion:*:git-checkout:*' sort false
# Set descriptions format to enable group support.
# NOTE: Don't use escape sequences here, fzf-tab will ignore them.
zstyle ':completion:*:descriptions' format '[%d]'
# Set list-colors to enable filename colorizing.
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
## Preview directory's content with `eza` when completing `cd`.
hash eza 2>/dev/null \
    && zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'
# Switch group using `<` and `>`.
zstyle ':fzf-tab:*' switch-group '<' '>'


####[[ End of File Configurations ]]####################################################
#### These are configurations that are specified to be placed at the end of the file, by
#### the developer/documentation.


# Initialize Starship prompt, if it is installed and $ZSH_THEME is not set.
hash starship 2>/dev/null \
    && [[ -z $ZSH_THEME ]] \
    && eval "$(starship init zsh)"


####[[ Others ]]########################################################################
#### These are generally configurations set up by setup scripts or other programs.

Oh-my-zsh Plugins

Below is a list of all the oh-my-zsh plugins that I use and find particularly useful.

Plugins Description Is a Command Other Info
colored-man-pages Adds colors to man pages No
copybuffer Allows you to copy what you are currently typing, via Ctrl+O Yes/No Key Combination: Ctrl+O
copypath Copies the path of your working directory Yes
copyfile Copies the contents of a file Yes
bgnotify cross-platform background notifications for long running commands Yes/No Extra install instructions
command-not-found This plugin uses the command-not-found package for zsh to provide suggested packages to be installed if a command cannot be found. No

Custom Aliases

Below is a list of aliases from my .zshrc files, organized into two groups: Group 1 and Group 2. Group 1 contains general aliases, while Group 2 includes aliases for categorized commands. Many of these commands are programs mentioned in the Useful Programs section that I don't use frequently but still want quick access to.

.zshrc
####[[ Aliases ]]#######################################################################


###
### [ Group 1 ]
###

## General aliases.
alias ic="cd ~/Library/Mobile\ Documents/com~apple~CloudDocs"
alias edisk="cd /Volumes && ll"
alias zls="eza"
alias rmdsstore="find . -name '*.DS_Store' -type f -delete"
alias code="open -a 'Visual Studio Code.app' ."
alias formatc="find . -name '*.cs' -type f -exec clang-format --style='file:$HOME/Programs/Mine/Formatter Configs/CSharp_clang-format/_clang-format' -i {} +"
alias updatebrew="brew update && brew upgrade && brew autoremove && brew cleanup && brew doctor"

###
### [ Group 2 ]
###
### Due to the number of commands that I find to be useful, I've created aliases
### containing some of these commands. They are specifically commands that I don't
### often use, but are useful to have on hand. Having these aliases allows me to see
### a list of these commands, without having to commit them to memeory.
###

alias lt="echo -e \"
####[ Package Manager installed commands ]##############################################

bandwhich - Terminal bandwidth utilization tool.
bat       - A cat(1) clone with wings.
codespell - Check code for common misspellings.
duf       - Disk Usage/Free Utility - a better 'df' alternative.
fzf       - A command-line fuzzy finder.
ncdu      - ncdu (NCurses Disk Usage) is a curses-based version of the well-known 'du'.
pstree    - List processes as a tree.
tmux      - Terminal multiplexer.

####[[ Grouped commands ]]##############################################################

lt_conversion - List of programs used for converting the formats of videos, images, etc.
lt_git        - List of programs used for git related commands.


####[ Keyboard combinations ]###########################################################

Ctrl + O - Allows you to copy what you are currently typing, via 'Ctrl' + 'O'.
\""
alias lt_conversion="echo -e \"
########################################################################################
#### [ Image and video formatters ]

ffmpeg - FFmpeg is a collection of libraries and tools to process multimedia content.
magick - Convert between image formats as well as resize an image, blur, crop,
         despeckle, dither, draw on, flip, join, re-sample, and much more.
\""
alias lt_git="echo -e \"
####[ Git Related Commands ]###########################################################

lazygit  - Simple terminal UI for git commands.
git open - Opens the GitHub page for a repo/branch in your browser.
ugit     - ugit helps you undo git commands without much effort.
\""
.zshrc
####[[ Aliases ]]#######################################################################


###
### [ Group 1 ]
###

## General aliases.
alias zls="eza"
alias formatc="find . -name '*.cs' -type f -exec clang-format --style='file:$HOME/Programs/Mine/Formatter Configs/CSharp_clang-format/_clang-format' -i {} +"
hash xdg-open 2>/dev/null && alias open="xdg-open"

## Update based aliases.
alias updateapt="sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt autoclean"
alias updatepacman="sudo pacman -Syu && yay && yay -Yc"

###
### [ Group 2 ]
###
### Due to the number of commands that I find to be useful, I've created aliases
### containing some of these commands. They are specifically commands that I don't
### often use, but are useful to have on hand. Having these aliases allows me to see
### a list of these commands, without having to commit them to memeory.
###

alias lt="echo -e \"
####[ Package Manager installed commands ]##############################################

bandwhich  - Terminal bandwidth utilization tool.
bat        - A cat(1) clone with wings.
cheat      - Allows you to create and view interactive cheatsheets on the command-line.
codespell  - Check code for common misspellings.
duf        - Disk Usage/Free Utility - a better 'df' alternative.
fzf        - A command-line fuzzy finder.
ncdu       - ncdu (NCurses Disk Usage) is a curses-based version of the well-known 'du'.
pstree     - List processes as a tree.
tmux       - Terminal multiplexer.

####[[ Grouped commands ]]##############################################################

lt_conversion - List of programs used for converting the formats of videos, images, etc.
lt_git        - List of programs used for git related commands.


####[ Keyboard combinations ]###########################################################

Ctrl + O - Allows you to copy what you are currently typing, via 'Ctrl' + 'O'.
\""
alias lt_conversion="echo -e \"
########################################################################################
#### [ Image and video formatters ]

ffmpeg - FFmpeg is a collection of libraries and tools to process multimedia content.
magick - Convert between image formats as well as resize an image, blur, crop,
         despeckle, dither, draw on, flip, join, re-sample, and much more.
\""
alias lt_git="echo -e \"
####[ Git Related Commands ]###########################################################

lazygit  - Simple terminal UI for git commands.
git open - Opens the GitHub page for a repo/branch in your browser.
ugit     - ugit helps you undo git commands without much effort.
\""

Modifying CLI Colors

You can customize the terminal colors for folders, files, and other items in the terminal by setting the LS_COLORS (Linux & macOS) or LSCOLORS (macOS) environment variables. To modify these colors, add the appropriate LS_COLORS or LSCOLORS variable to your .zshrc file.

LS_COLORS & LSCOLORS Explained

On macOS, both LSCOLORS and LS_COLORS are necessary for specifying terminal colors. The LSCOLORS environment variable is used by commands like ls to determine the colors displayed in the terminal, while LS_COLORS is used by zsh for similar purposes. In contrast, Linux only requires LS_COLORS, which is utilized by both commands like ls and zsh.

This difference arises from the distinct versions of the ls command on macOS and Linux. macOS employs the FreeBSD version of ls, which relies on LSCOLORS for color settings, whereas Linux uses the GNU version, which depends on LS_COLORS. Each variable has its own unique formatting. Additionally, since zsh recognizes only the LS_COLORS format, it's important to set this variable on macOS to ensure proper display and functionality of CLI colors.

Included below is a key that explains the values of LSCOLORS and LS_COLORS in my configurations:

LSCOLORS LS_COLORS Type Text Color Foreground/Background Color
ex di=34 Directories blue default
gx ln=36 Symbolic link cyan default
fx so=35 Socket magenta default
Dx pi=1;33 Pipe bold yellow default
cx ex=32 Executable green default
eg bd=34;46 Block special green cyan
Da cd=1;33;40 Character special bold yellow black
ab su=30;41 Executable with setuid bit set black red
ag sg=30;46 Executable with setgid bit set black cyan
ac tw=30;42 Directory writeable to others (with a sticky bit) black green
aD ow=30;1;43 Directory writeable to others (without sticky bit) black bold yellow

For an in-depth understanding of LS_COLORS and LSCOLORS, I recommend visiting this gist.

Below are my configurations for both macOS and Linux systems. To apply these settings, simply add the following code to your ~/.zshrc file:

CLI Color Configuration
1
2
3
4
5
6
7
8
9
# Modifies the colors of files and directories when using `ls`.
export LSCOLORS="exgxfxDxcxegDaabagacaD"
## Version of LSCOLORS compatible with zsh and GNU based commands.
## You can find more information about LS_COLORS and why it's needed in addition to LSCOLORS,
## here: https://github.com/ohmyzsh/ohmyzsh/issues/6060#issuecomment-327934559
export LS_COLORS="di=34:ln=36:so=35:pi=1;33:ex=32:bd=34;46:cd=1;33;40:su=30;41:sg=30;46:tw=30;42:ow=30;1;43"

# Set list-colors to enable filename colorizing.
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
CLI Color Configuration
1
2
3
4
5
# Modifies the colors of files and directories in the terminal.
export LS_COLORS="di=34:ln=36:so=35:pi=1;33:ex=32:bd=34;46:cd=1;33;40:su=30;41:sg=30;46:tw=30;42:ow=30;1;43"

# Set list-colors to enable filename colorizing.
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}

You can further modify the shading and appearance of CLI colors by adjusting the ANSI color scheme in your terminal profile. This can be done manually, with guides available for both macOS and Linux (specific to GNOME). Alternatively, you can use my custom profile schemes, which are detailed in the Terminal Profile section.

Neovim Resource File

Due to Neovim's extensibility and active community, I have chosen it as my primary text editor, preferring it over the traditional Vi or Vim. Below are the configurations for my init.vim file. The configurations are organized into two sections: one with plugins and one without.

With Plugins

The following configurations modify the behavior and appearance of Neovim. To use these settings, you'll first need to install vim-plug, a plugin manager for Vim. While other Vim package managers are available, these configurations are specifically tailored for vim-plug.

After installing vim-plug, copy the code below into your ~/.config/nvim/init.vim file. With init.vim open in Neovim, initiate the plugin installation by entering :source % followed by :PlugInstall.

Note

When using :source %, you can safely ignore any errors that may appear, as they are most likely caused by Neovim searching for plugins that have not yet been installed.

Vim Plugin Information

Below is a list of all the plugins included in my init.vim, each accompanied by a description of its functionality.

Plugins Description
HiPhish/rainbow-delimiters.nvim Rainbow delimiters for Neovim with Tree-sitter.
vim-airline/vim-airline Lean & mean status/tabline for vim that's light as air.
vim-airline/vim-airline-themes A collection of themes for vim-airline.
morhetz/gruvbox Retro groove color scheme for Vim.
dense-analysis/ale Check syntax in Vim asynchronously and fix files, with Language Server Protocol (LSP) support.
ntpeters/vim-better-whitespace Better whitespace highlighting for Vim.
nvim-treesitter/nvim-treesitter Nvim Treesitter configurations and abstraction layer.
mechatroner/rainbow_csv Highlight columns in CSV and TSV files and run queries in SQL-like language.
init.vim
""""[ vim-plug Configurations ]"""""""""""""""""""""""""""""""""""""""""""""""""""""""""


call plug#begin(stdpath('data') . '/plugged')
" Make sure you use single quotes

" Vim help for vim-plug itself
Plug 'junegunn/vim-plug'

" Rainbow delimiters for Neovim with Tree-sitter.
Plug 'HiPhish/rainbow-delimiters.nvim'
" Lean & mean status/tabline for vim that's light as air.
Plug 'vim-airline/vim-airline'
" A collection of themes for vim-airline.
Plug 'vim-airline/vim-airline-themes'
" Retro groove color scheme for Vim.
Plug 'sainnhe/gruvbox-material'
" Check syntax in Vim asynchronously and fix files, with Language Server Protocol (LSP)
" support.
Plug 'dense-analysis/ale'
" Better whitespace highlighting for Vim.
Plug 'ntpeters/vim-better-whitespace'
" An incremental parsing system for programming tools.
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
" Highlight columns in CSV and TSV files and run queries in SQL-like language.
Plug 'mechatroner/rainbow_csv'
" A simple and lightweight Neovim plugin that brings syntax highlighting to generic log
" patterns and provides straight-forward configuration to manage the filetype detection
" rules over your preferred log files.
Plug 'fei6409/log-highlight.nvim'

" Initialize plugin system
call plug#end()
"
" Brief help:
"   PlugInstall  - Install plugins
"   PlugUpdate   - Install or update plugins
"   PlugClean    - Remove unlisted plugins (bang version will clean without prompt)
"   PlugUpgrade  - Upgrade vim-plug itself
"   PlugStatus   - Check the status of plugins
"   PlugDiff     - Examine changes from the previous update and the pending changes
"   PlugSnapshot - Generate script for restoring the current snapshot of the plugins


""""[ General Configurations ]"""""""""""""""""""""""""""""""""""""""""""""


"""
""" Overwrites specified default setting.
"""

"" Overwrite for all file types.
set expandtab       " Use spaces instead of tabs.
set tabstop=4       " Number of spaces that a <Tab> in the file counts for.
set shiftwidth=4    " Number of spaces to use for each step of (auto)indent.
set softtabstop=4   " Number of spaces that a <Tab> in the file counts for.
set endofline       " Keep the last line of a file if it has no newline.
set fixendofline    " Ensures a newline at the end of the file, if endofline is enabled.
set colorcolumn=88  " Set a colored line at column 88 in every row.

"" Filetype-specific configurations.
autocmd Filetype markdown,text,csv setlocal colorcolumn=0
autocmd Filetype java setlocal colorcolumn=100
autocmd Filetype cs setlocal colorcolumn=120
" As recommended by the luarocks Style Guide:
" https://github.com/luarocks/lua-style-guide/blob/master/README.md
autocmd Filetype lua setlocal tabstop=3 shiftwidth=3 softtabstop=3
autocmd Filetype html,css,vue,javascript,typescript setlocal colorcolumn=100 tabstop=2 shiftwidth=2 softtabstop=2


""""[ vim-plug Plugin Configurations ]""""""""""""""""""""""""""""""""""""""""""""""""""


" Font: Power Line Font
set guifont=MesloLGS_NF:h12

"" Plugin: gruvbox-material
colorscheme gruvbox-material
set background=dark
let g:gruvbox_material_foreground = 'original'
let g:gruvbox_material_enable_bold = 1
let g:gruvbox_material_enable_italic = 1

"" Plugin: vim-airline
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline#extensions#tabline#formatter = 'default'
let g:airline#extensions#ale#enabled = 1
let g:airline_powerline_fonts = 1

"" Plugin: better-whitespace
let g:better_whitespace_enabled = 1
let g:strip_whitespace_on_save = 1

"" Plugin: ale
"let g:ale_use_neovim_diagnostics_api = 0


""""[ Lua Configurations ]""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""


lua dofile(vim.fn.stdpath('config') .. '/second_init.lua')


""""[ Useful Commands ]"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""


" :NERDTree        - Opens NERDTree file system explorer.
" :StripWhitespace - Clean extra whitespace.
" :ALEInfo         - Show ALE information.
" :ALEToggle       - Toggle ALE on/off.
" :TSInstall       - Install treesitter parsers.
" :TSUpdate        - Update treesitter parsers.
" :TSInstallInfo   - Show treesitter information.

Without Vim-Plug Plugins

If you prefer a simpler setup without all the features provided by plugins, you can add the configurations below to your init.vim file. These adjustments tweak Vim's default settings without changing its core functionality, offering a more streamlined experience while preserving Vim's essential behavior.

init.vim
""""[ General Configurations ]"""""""""""""""""""""""""""""""""""""""""""""


"""
""" Overwrites specified default setting.
"""

"" Overwrite for all file types.
set expandtab       " Use spaces instead of tabs.
set tabstop=4       " Number of spaces that a <Tab> in the file counts for.
set shiftwidth=4    " Number of spaces to use for each step of (auto)indent.
set softtabstop=4   " Number of spaces that a <Tab> in the file counts for.
set endofline       " Keep the last line of a file if it has no newline.
set fixendofline    " Ensures a newline at the end of the file, if endofline is enabled.
set colorcolumn=88  " Set a colored line at column 88 in every row.

"" Filetype-specific configurations.
autocmd Filetype markdown,text,csv setlocal colorcolumn=0
autocmd Filetype java setlocal colorcolumn=100
autocmd Filetype cs setlocal colorcolumn=120
" As recommended by the luarocks Style Guide:
" https://github.com/luarocks/lua-style-guide/blob/master/README.md
autocmd Filetype lua setlocal tabstop=3 shiftwidth=3 softtabstop=3
autocmd Filetype html,css,vue,javascript,typescript setlocal colorcolumn=100 tabstop=2 shiftwidth=2 softtabstop=2

Neovim GitHub Copilot

...coming soon...

Installed TreeSitter Parsers

...coming soon...

Terminal Profile

My custom terminal profile is a modified version of the Basic profile that comes pre-installed on macOS. To add it to your list of profiles, follow these steps:

  1. Download the terminal profile: Basic (Modified).terminal
  2. Open a new terminal window.
  3. Import the profile:
    1. Go to Preferences.
    2. Navigate to the Profiles tab.
    3. Click on the gear icon at the bottom left of the window.
    4. Select Import....
    5. Locate and select the downloaded Basic (Modified).terminal file.
  4. Set as default profile:
    1. Select the newly imported terminal profile from the list.
    2. Click the Default button at the bottom of the window to set it as your default profile.

My custom terminal profile is a based on the one I use on macOS. To add it to your list of profiles, follow the instructions below:

  1. Download the terminal profile: Gnome Basic (Modified).dconf
  2. Download the profile setup script: gnome-terminal-profile-setup.bash
  3. Open a new terminal window.
  4. Navigate to the directory where you downloaded both files.
  5. Execute the code:
    chmod +x gnome-terminal-profile-setup.bash
    ./gnome-terminal-profile-setup.bash