Last active
June 20, 2025 16:44
-
-
Save limkhashing/414c9a74b381286977718934591a4a55 to your computer and use it in GitHub Desktop.
ZSH config for Terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########## Shell Configuration ########## | |
if [[ -f "/opt/homebrew/bin/brew" ]] then | |
# If you're using macOS, you'll want this enabled | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
fi | |
# Set the directory we want to store zinit and plugins | |
ZINIT_HOME="${XDG_DATA_HOME:-${HOME}/.local/share}/zinit/zinit.git" | |
# Download Zinit, if it's not there yet | |
if [ ! -d "$ZINIT_HOME" ]; then | |
mkdir -p "$(dirname $ZINIT_HOME)" | |
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME" | |
fi | |
# Source/Load zinit | |
source "${ZINIT_HOME}/zinit.zsh" | |
# Add in zsh plugins | |
zinit light zsh-users/zsh-syntax-highlighting | |
zinit light zsh-users/zsh-completions | |
zinit light zsh-users/zsh-autosuggestions | |
zinit light Aloxaf/fzf-tab | |
zinit light starship/starship | |
# Add in snippets | |
zinit snippet OMZL::git.zsh | |
zinit snippet OMZP::git | |
zinit snippet OMZP::sudo | |
zinit snippet OMZP::archlinux | |
zinit snippet OMZP::aws | |
zinit snippet OMZP::kubectl | |
zinit snippet OMZP::kubectx | |
zinit snippet OMZP::command-not-found | |
# Load completions | |
autoload -Uz compinit && compinit | |
zinit cdreplay -q | |
# Keybindings | |
bindkey -e | |
bindkey '^p' history-search-backward | |
bindkey '^n' history-search-forward | |
bindkey '^[w' kill-region | |
# History | |
HISTSIZE=5000 | |
HISTFILE=~/.zsh_history | |
SAVEHIST=$HISTSIZE | |
HISTDUP=erase | |
setopt appendhistory | |
setopt sharehistory | |
setopt hist_ignore_space | |
setopt hist_ignore_all_dups | |
setopt hist_save_no_dups | |
setopt hist_ignore_dups | |
setopt hist_find_no_dups | |
# Completion styling | |
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' | |
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" | |
zstyle ':completion:*' menu no | |
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# starship.toml | |
format = """ | |
[╭](fg:current_line)\ | |
$os\ | |
$directory\ | |
$git_branch\ | |
$git_status\ | |
$fill\ | |
$nodejs\ | |
$bun\ | |
$deno\ | |
$aws\ | |
$cmd_duration\ | |
$shell\ | |
$time\ | |
$username\ | |
$line_break\ | |
$character\ | |
""" | |
palette = 'dracula' | |
add_newline = true | |
[palettes.dracula] | |
foreground = '#F8F8F2' | |
background = '#282A36' | |
current_line = '#44475A' | |
primary = '#1E1F29' | |
box = '#44475A' | |
blue = '#6272A4' | |
cyan = '#8BE9FD' | |
green = '#50FA7B' | |
orange = '#FFB86C' | |
pink = '#FF79C6' | |
purple = '#BD93F9' | |
red = '#FF5555' | |
yellow = '#F1FA8C' | |
[os] | |
format = '(fg:current_line)[](fg:red)[$symbol ](fg:primary bg:red)[](fg:red)' | |
disabled = false | |
[os.symbols] | |
Alpine = '' | |
Amazon = '' | |
Android = '' | |
Arch = '' | |
CentOS = '' | |
Debian = '' | |
EndeavourOS = '' | |
Fedora = '' | |
FreeBSD = '' | |
Garuda = '' | |
Gentoo = '' | |
Linux = '' | |
Macos = '' | |
Manjaro = '' | |
Mariner = '' | |
Mint = '' | |
NetBSD = '' | |
NixOS = '' | |
OpenBSD = '' | |
OpenCloudOS = '' | |
openEuler = '' | |
openSUSE = '' | |
OracleLinux = '⊂⊃' | |
Pop = '' | |
Raspbian = '' | |
Redhat = '' | |
RedHatEnterprise = '' | |
Solus = '' | |
SUSE = '' | |
Ubuntu = '' | |
Unknown = '' | |
Windows = '' | |
[directory] | |
format = '[─](fg:current_line)[](fg:pink)[ ](fg:primary bg:pink)[](fg:pink bg:box)[ $read_only$truncation_symbol$path](fg:foreground bg:box)[](fg:box)' | |
home_symbol = " ~/" | |
truncation_symbol = ' ' | |
truncation_length = 2 | |
read_only = ' ' | |
read_only_style = '' | |
[git_branch] | |
format = '[─](fg:current_line)[](fg:green)[$symbol](fg:primary bg:green)[](fg:green bg:box)[ $branch](fg:foreground bg:box)' | |
symbol = ' ' | |
[git_status] | |
format = '[( $all_status)](fg:foreground bg:box)[](fg:box)' | |
[nodejs] | |
format = '[─](fg:current_line)[](fg:green)[$symbol](fg:primary bg:green)[](fg:green bg:box)[ $version](fg:foreground bg:box)[](fg:box)' | |
detect_files = ["package.json", ".node-version", "!bunfig.toml", "!bun.lockb"] | |
[bun] | |
format = '[─](fg:current_line)[](fg:green)[$symbol](fg:primary bg:green)[](fg:green bg:box)[ $version](fg:foreground bg:box)[](fg:box)' | |
symbol = '🥟' | |
[deno] | |
format = '[─](fg:current_line)[](fg:green)[$symbol](fg:primary bg:green)[](fg:green bg:box)[ $version](fg:foreground bg:box)[](fg:box)' | |
symbol = '🦕' | |
[aws] | |
format = '[─](fg:current_line)[](fg:purple)[$symbol](fg:primary bg:purple)[](fg:purple bg:box)[ $profile](fg:foreground bg:box)[](fg:box)' | |
symbol = '☁️' | |
[fill] | |
symbol = '─' | |
style = 'fg:current_line' | |
[cmd_duration] | |
min_time = 500 | |
format = '[─](fg:current_line)[](fg:orange)[ ](fg:primary bg:orange)[](fg:orange bg:box)[ $duration ](fg:foreground bg:box)[](fg:box)' | |
[shell] | |
format = '[─](fg:current_line)[](fg:blue)[ ](fg:primary bg:blue)[](fg:blue bg:box)[ $indicator](fg:foreground bg:box)[](fg:box)' | |
disabled = false | |
[time] | |
format = '[─](fg:current_line)[](fg:purple)[ ](fg:primary bg:purple)[](fg:purple bg:box)[ $time](fg:foreground bg:box)[](fg:box)' | |
time_format = '%H:%M' | |
disabled = false | |
[username] | |
format = '[─](fg:current_line)[](fg:yellow)[ ](fg:primary bg:yellow)[](fg:yellow bg:box)[ $user](fg:foreground bg:box)[](fg:box) ' | |
show_always = true | |
[character] | |
format = """ | |
[│](fg:current_line) | |
[╰─$symbol](fg:current_line) """ | |
success_symbol = '[](fg:bold green)' | |
error_symbol = '[](fg:bold red)' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# starship.toml | |
format = """ | |
$username\ | |
$hostname\ | |
$directory\ | |
$git_branch\ | |
$git_state\ | |
$git_status\ | |
$cmd_duration\ | |
$line_break\ | |
$python\ | |
$character""" | |
[directory] | |
style = "blue" | |
[character] | |
success_symbol = "[❯](purple)" | |
error_symbol = "[❯](red)" | |
vimcmd_symbol = "[❮](green)" | |
[git_branch] | |
format = "[$branch]($style)" | |
style = "bright-black" | |
[git_status] | |
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)" | |
style = "cyan" | |
conflicted = "" | |
untracked = "" | |
modified = "" | |
staged = "" | |
renamed = "" | |
deleted = "" | |
stashed = "≡" | |
[git_state] | |
format = '\([$state( $progress_current/$progress_total)]($style)\) ' | |
style = "bright-black" | |
[cmd_duration] | |
format = "[$duration]($style) " | |
style = "yellow" | |
[python] | |
format = "[$virtualenv]($style) " | |
style = "bright-black" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# starship.toml | |
add_newline = false | |
palette = "default" | |
format = """ | |
[╭](fg:separator)\ | |
$status\ | |
$directory\ | |
$cmd_duration\ | |
$line_break\ | |
[╰](fg:separator)\ | |
$character\ | |
""" | |
########################################### | |
[palettes.default] | |
prompt_ok = "#8047c1" | |
prompt_err = "#e23140" | |
icon = "#161514" | |
separator = "#35312c" | |
background = "#35312c" | |
directory = "#9f31e2" | |
duration = "#e26f31" | |
status = "#e23140" | |
########################################### | |
[character] | |
success_symbol = "[❯](fg:prompt_ok)" | |
error_symbol = "[❯](fg:prompt_err)" | |
[directory] | |
format = "[─](fg:separator)[](fg:directory)[](fg:icon bg:directory)[](fg:directory bg:background)[ $path](bg:background)[](fg:background)" | |
truncate_to_repo = false | |
truncation_length = 0 | |
[status] | |
format = "[─](fg:separator)[](fg:status)[](fg:icon bg:status)[](fg:status bg:background)[ $status](bg:background)[](fg:background)" | |
pipestatus = true | |
pipestatus_separator = "-" | |
pipestatus_segment_format = "$status" | |
pipestatus_format = "[─](fg:separator)[](fg:status)[](fg:icon bg:status)[](fg:status bg:background)[ $pipestatus](bg:background)[](fg:background)" | |
disabled = false | |
[cmd_duration] | |
format = "[─](fg:separator)[](fg:duration)[](fg:icon bg:duration)[](fg:duration bg:background)[ $duration](bg:background)[](fg:background)" | |
min_time = 1000 | |
[time] | |
format = "[](fg:duration)[](fg:icon bg:duration)[](fg:duration bg:background)[ $time](bg:background)[](fg:background)" | |
disabled = false |
Starship theme
- https://github.com/hendrikmi/dotfiles/blob/3cf2c969323e1f33255743b04d9d7750cfee7496/starship/starship.toml
- https://github.com/theRubberDuckiee/dev-environment-files/blob/main/starship.toml
- https://gitlab.com/dwt1/dotfiles/-/blob/master/.config/starship.toml?ref_type=heads
- starship/starship#1107
- starship/starship#1252
- https://github.com/christianlempa/dotfiles/blob/main/.config/starship.toml
- https://github.com/c-neto/ansible-setup-my-workstation/blob/main/files/dotfiles/starship.toml
Terminal Emulator
- Wrap
- Ghostty
- iTerm2
- alacritty
- Tabby
Shell
Reference
- Install fonts
- Caskaydian Mono
- Fira Mono
- Jetbrains
- MesloLG Nerd
- Install bash or zshrc theme
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh My Posh Theme