Last active
October 15, 2025 19:37
-
-
Save azmarifdev/550f16ba8722b3e256610025b96a4693 to your computer and use it in GitHub Desktop.
zsh with oh my zsh configuration
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
| # ========================================= | |
| # π Advanced Zsh Configuration by A.Z.M. Arif | |
| # ========================================= | |
| # --- Basic Environment Settings --- | |
| export ZSH="$HOME/.oh-my-zsh" | |
| export EDITOR="nvim" | |
| export TERMINAL="kitty" | |
| export LANG="en_US.UTF-8" | |
| export LC_ALL="en_US.UTF-8" | |
| # --- Theme (Starship overrides this visually) --- | |
| ZSH_THEME="gnzh" | |
| # --- Oh My Zsh Core Plugins --- | |
| plugins=( | |
| git | |
| fzf | |
| sudo | |
| history-substring-search | |
| colored-man-pages | |
| ) | |
| # --- Load Oh My Zsh --- | |
| if [ -s "$ZSH/oh-my-zsh.sh" ]; then | |
| source "$ZSH/oh-my-zsh.sh" | |
| else | |
| echo "β οΈ Oh My Zsh not found at $ZSH" | |
| fi | |
| # --- Disable unwanted ZLE widgets (prevents syntax-highlighting warnings) --- | |
| zle -D menu-search 2>/dev/null || true | |
| zle -D recent-paths 2>/dev/null || true | |
| # ========================================= | |
| # π§ Starship Prompt | |
| # ========================================= | |
| if command -v starship >/dev/null 2>&1; then | |
| export STARSHIP_CONFIG="$HOME/.config/starship.toml" | |
| eval "$(command starship init zsh)" | |
| else | |
| echo "β οΈ Starship not installed. Install via: sudo pacman -S starship" | |
| fi | |
| # ========================================= | |
| # β‘ Performance Tweaks | |
| # ========================================= | |
| zmodload zsh/complist | |
| autoload -Uz compinit && compinit -C | |
| zstyle ':completion:*' rehash true | |
| zstyle ':completion:*' menu select | |
| zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' | |
| setopt no_beep noclobber prompt_subst nomatch extended_glob | |
| # ========================================= | |
| # π₯οΈ Aliases | |
| # ========================================= | |
| alias ls='exa --icons --color=always' | |
| alias ll='exa -lah --icons --color=always' | |
| alias tree='exa --tree --level=2 --icons' | |
| alias c='clear' | |
| alias v='nvim' | |
| alias gs='git status' | |
| alias gl='git log --oneline --graph --decorate' | |
| alias update='sudo pacman -Syu' | |
| alias ports='sudo lsof -i -P -n | grep LISTEN' | |
| alias ..='cd ..' | |
| alias ...='cd ../..' | |
| alias nf='neofetch' | |
| # ========================================= | |
| # πͺ Functions | |
| # ========================================= | |
| mkcd() { mkdir -p "$1" && cd "$1"; } | |
| extract() { | |
| if [ -f "$1" ]; then | |
| case "$1" in | |
| *.tar.bz2) tar xjf "$1" ;; | |
| *.tar.gz) tar xzf "$1" ;; | |
| *.bz2) bunzip2 "$1" ;; | |
| *.rar) unrar x "$1" ;; | |
| *.gz) gunzip "$1" ;; | |
| *.tar) tar xf "$1" ;; | |
| *.tbz2) tar xjf "$1" ;; | |
| *.tgz) tar xzf "$1" ;; | |
| *.zip) unzip "$1" ;; | |
| *.Z) uncompress "$1" ;; | |
| *.7z) 7z x "$1" ;; | |
| *) echo "β '$1' cannot be extracted" ;; | |
| esac | |
| else | |
| echo "β '$1' is not a valid file" | |
| fi | |
| } | |
| # ========================================= | |
| # π‘ History Settings | |
| # ========================================= | |
| HISTFILE=~/.zsh_history | |
| HISTSIZE=20000 | |
| SAVEHIST=20000 | |
| setopt share_history hist_ignore_dups hist_reduce_blanks | |
| # ========================================= | |
| # π§ Key Bindings | |
| # ========================================= | |
| bindkey '^P' up-line-or-history | |
| bindkey '^N' down-line-or-history | |
| # ========================================= | |
| # β Final Touch | |
| # ========================================= | |
| # No random echo message at startup, only clean prompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment