Terminal setup for zsh in macOS, Ubuntu/Debian, and Windows.
- Cross-platform support (macOS, Ubuntu/Debian, and Windows)
- Customizable zsh configuration
- Powerline10k theme for a beautiful and informative prompt
- Zinit plugin manager with the following plugins:
- zdharma-continuum/fast-syntax-highlighting: Provides syntax highlighting for commands while they are typed
- zsh-users/zsh-completions: Additional completion definitions for Zsh
- zsh-users/zsh-history-substring-search: Fish shell-like history search feature
- zsh-users/zsh-autosuggestions: Fish-like autosuggestions for Zsh
- Prezto modules:
- helper: Provides helper functions for other modules
- git: Enhances the Git distributed version control system
- gnu-utility: Provides for the interactive use of GNU utilities on non-GNU systems
- utility: Provides general aliases and functions
- Auto-switching Node.js versions using asdf
- Quickly jump to different directories with jump
- Git helpers and automatic version checking
- Rust version checking
- Customizable aliases and functions for improved productivity
- Automatic software updates (Homebrew, apt, etc.)
- Terminal Integration
- iTerm2 (macOS)
- Alacritty (macOS, Linux, Windows)
- Windows Terminal (Windows or WSL)
-
To customize your own configs, you can fork this project before running the below installation script
-
Run the below to setup the terminal automatically:
sudo curl -fsSL https://raw.githubusercontent.com/saltchang/terminal-setup/HEAD/install.sh | sh -
It will setup the terminal by the below steps:
- Install homebrew, coreutils, python and pipx for macOS
- Install fonts: Meslo & Fira Code
- Install and setup zsh
- Clone this project into
$HOME/projects/personal/terminal-setup
- Create a soft link from
$HOME/.zshrc
to the one in this project - Create a soft link from
$HOME/.p10k.zsh
to the one in this project - Create a soft link from
$HOME/.local/terminal-setup/bin
to the one in this project - Optionally install pnpm
- Optionally install and setup terminal (iTerm2 or Alacritty)
-
After the installation, restart your terminal or run
source $HOME/.zshrc
, you should see the new face of the shell
For Windows, see Windows Section
-
Install iTerm2
brew install --cask iterm2
-
Download this iTerm Profile
-
Open your iTerm > Settings > Profiles > Other Actions > Import JSON Profiles > Choose the downloaded profile
-
After you setup: Other Actions > Set as Default
-
Restart iTerm
-
Install Alacritty
-
You can setup the config by copying the Alacritty Config to your
~/.config/alacritty/alacritty.toml
or run the install script:./setup-alacritty.sh
It will create a symbolic link to the config from your
~/.config/alacritty/alacritty.toml
To customize your own configs, you can fork this project before the below steps.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
GNU-coreutils is required for some commands in macOS.
brew install coreutils
brew install python
brew install pipx
Please install at least one of the below fonts for your terminal, Menlo is recommended.
See all Nerd Fonts.
Fira Code is recommended for your editor such as VS Code.
brew tap homebrew/cask-fonts
brew install --cask font-fira-code
sudo apt install fonts-firacode
It's recommended to put the project under $HOME/projects/personal
:
mkdir -p $HOME/projects/personal
cd $HOME/projects/personal
Then clone this project (if you forked it, replace the URL with your own):
-
use SSH
git clone [email protected]:saltchang/terminal-setup.git
-
use HTTPS
git clone https://github.com/saltchang/terminal-setup.git
Since Catalina, macOS will use zsh as the default shell, so you should have zsh built-in in your system
sudo apt update && sudo apt -y install zsh
Then restart your terminal
To setup the shell, just run the script:
cd terminal-setup
./setup.sh
It will create a soft link from ~/.zshrc
to the one in this project, check dotfiles/.zshrc
.
Now restart your terminal or run source ~/.zshrc
, you should see the new face of the shell.
Run the below command to open your .zshrc
:
edit-rc
Or use the shortcut to go to the terminal-setup
repo:
go-rc-repo
Then you can start to customize your shell.
If you would like to customize the color scheme of powerlevel10k, please see This chart.
This setup includes several custom functions and aliases to improve your productivity. Here's a list of what's available:
cl
: Change to a directory and list its contentshome
: Change to the home directory and display a welcome messagegow
: Go to the work projects directorygop
: Go to the personal projects directorygol
: Go to the libraries directoryodg
: Interactive menu to select and go to different IXT projectsselect_menu
: Interactive menu to select an option from a listupdate_git
: Check for and update Git to the latest versionupdate_terminal_setup
: Update the terminal setup itselfload-node-version
: Automatically use the correct Node.js version based on .tool-versions or .nvmrc files
edit
: Open files in the default editor (set to VSCode)edit-rc
: Edit the .zshrc filego-rc-repo
: Go to the terminal setup repositoryedit-ssh
: Edit the SSH config filesource-rc
: Source (reload) the .zshrc filepaths
: Display all directories in PATH, one per lineweather
: Show weather information using wttr.in
gclb
: Clean local branches (except main and develop)gclmb
: Clean merged branchesgfap
: Fetch all and pullgfapr
: Fetch all and pull with rebasegpuoc
: Push and set upstream to origin for the current branch
macOS:
unu
: Update and upgrade Homebrew packages
Linux:
unu
: Update and upgrade apt packagesffind
: Fuzzy find filesmonitor
: Monitor system resources using gotopmand
: Analyze disk usage with ncdu (excluding /mnt)
docker-all
: List all Docker containers with detailsdocker-ls
: List running Docker containers with details
c
: Clear the terminalpython
: Alias for python3pip
: Alias for pip3
If you're seeing boxes or question marks instead of special characters in your prompt:
- Make sure you've installed the recommended fonts (Meslo or FiraCode).
- Ensure your terminal is set to use one of these fonts.
- If using iTerm2, go to Settings > Profiles > Text and select the appropriate font.
If automatic Node.js version switching isn't working:
- Make sure asdf is properly installed and configured.
- Check if you have a
.tool-versions
or.nvmrc
file in your project directory. - Try running
asdf reshim nodejs
after installing a new Node.js version.
For any other issues, please open an issue on the GitHub repository.
- Open your Windows Terminal > Settings > Open JSON file
- Copy json configs from this config file
- Paste the config to the Windows Terminal config json you just opened
- Restart Windows Terminal
See PowerShell Setup
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.