Skip to content

Instantly share code, notes, and snippets.

@ivangarzab
Last active February 21, 2026 18:04
Show Gist options
  • Select an option

  • Save ivangarzab/3850af4ca63fe088f74c84bf5acfeae4 to your computer and use it in GitHub Desktop.

Select an option

Save ivangarzab/3850af4ca63fe088f74c84bf5acfeae4 to your computer and use it in GitHub Desktop.
Terminal Setup
# ============================================
# Minimal zsh Configuration
# ============================================
# --- Basic zsh settings ---
setopt AUTO_CD # Type directory name to cd into it
setopt HIST_IGNORE_DUPS # Don't save duplicate commands in history
setopt SHARE_HISTORY # Share history across all terminals
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
# --- Enable completion system ---
autoload -Uz compinit
compinit
# --- Git alias completions ---
# When adding a new git alias above, add a corresponding compdef line here
# This enables git-aware tab completion for each alias
compdef _git gs=git-status
compdef _git gf=git-fetch
compdef _git gc=git-checkout
compdef _git gl=git-log
compdef _git gup=git-push
compdef _git gu=git-submodule
compdef _git gst=git-stash
compdef _git gwhere=git-remote
compdef _git git-discard=git-reset
compdef _git gst-export=git-stash
# --- Initialize Starship Prompt ---
eval "$(starship init zsh)"
# --- Syntax Highlighting ---
if [ -f ~/.zsh-plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh ]; then
source ~/.zsh-plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
fi
# --- Git Command Shortcuts ---
alias gs='git status'
alias gf='git fetch -p'
alias gc='git checkout'
alias gl='git log --oneline'
alias gup='git push -u origin'
alias gu='git submodule update --init --recursive'
alias gst='git stash'
alias gst-export='git stash show stash@{0} -p > changes.patch'
alias git-discard='git reset --hard @{u}'
alias gwhere='git remote -v'
alias gprune='!git fetch -p && git branch -vv | awk '/: gone]/{print \$1}' | xargs -r git branch -d'
# Git help - show all git aliases
alias git-help='cat << "EOF"
Git Aliases:
---------------------------------------------------------------
gs git status
gf git fetch -p (prune stale branches)
gc git checkout
gl git log --oneline
gup git push -u origin (set upstream and push)
gu git submodule update --init --recursive
gst git stash
gst-export git stash show stash@{0} -p > changes.patch
git-discard git reset --hard @{u} (discard local changes)
gwhere git remote -v (show remotes)
gprune git branch -vv | awk "/: gone]/{print \$1}" | xargs -r git branch -d (delete all stale branches locally)
---------------------------------------------------------------
EOF
'
# --- Add local bin to PATH ---
export PATH="$HOME/.local/bin:$PATH"
export EDITOR="zed --wait"
export VISUAL="zed --wait"

Terminal Setup - Installation Guide

Quick setup guide for configuring your terminal on a new machine.

Prerequisites

  • macOS (or Linux with Homebrew installed)
  • Git

Installation Steps

1. Install Starship

brew install starship

2. Clone Syntax Highlighting Plugin

mkdir -p ~/.zsh-plugins
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting ~/.zsh-plugins/fast-syntax-highlighting

3. Download Configuration Files

# Download .zshrc
curl https://gist.githubusercontent.com/ivangarzab/3850af4ca63fe088f74c84bf5acfeae4/raw/.zshrc > ~/.zshrc

# Create config directory if it doesn't exist
mkdir -p ~/.config

# Download starship.toml
curl https://gist.githubusercontent.com/ivangarzab/3850af4ca63fe088f74c84bf5acfeae4/raw/starship.toml > ~/.config/starship.toml

4. Restart Your Terminal

Close and reopen your terminal, or run:

source ~/.zshrc
# Starship Configuration
# Use custom color palette (defined at bottom)
palette = "custom"
# Format: ◀ directory[git_branch](git_status)▶ prompt...
format = """
[◀](bold primary) \
[](bold primary)\
[$directory](primary)\
$git_branch\
$git_status\
[ ▶](bold primary) \
$character"""
# Disable command duration by default
[cmd_duration]
disabled = true
# Character (the prompt symbol)
[character]
success_symbol = ""
error_symbol = ""
# Directory settings
[directory]
format = "[$path](bold $style)"
style = "primary"
truncation_length = 3
truncate_to_repo = true
# Git branch
[git_branch]
format = "[\\[[$branch](secondary)\\]]($style)"
style = "primary"
# Git status
# Shows only: 1) dirty working dir, 2) commits to push, 3) commits to pull, 4) conflicts
[git_status]
format = "([\\(](primary)[$conflicted$modified$staged$untracked$deleted$renamed$ahead_behind]($style)[\\)](primary))"
style = "primary"
modified = "[⁑](tertiary)"
staged = "[⁑](tertiary)"
untracked = "[⁑](tertiary)"
deleted = "[⁑](tertiary)"
renamed = "[⁑](tertiary)"
conflicted = "[⚔](red)"
ahead = "[▲$count](up)"
behind = "[▼$count](down)"
diverged = "[▲$ahead_count](up)[▼$behind_count](down)"
# Color Palette
[palettes.custom]
primary = "#B19CD9" # lavender
secondary = "#FFDB58" # mustard yellow
tertiary = "#FFFFED" # cream
down = "#F15A22" # UTSA orange
up = "#265BF7" # UTSA alt blue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment