Files
dotfiles/.zshrc
2025-06-11 06:59:18 +09:00

73 lines
1.3 KiB
Bash

# ================================
# zsh configuration
# ================================
# History
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_FIND_NO_DUPS
setopt HIST_REDUCE_BLANKS
setopt SHARE_HISTORY
# Directory navigation
setopt AUTO_CD
setopt AUTO_PUSHD
setopt PUSHD_IGNORE_DUPS
# Completion
autoload -Uz compinit
compinit
setopt AUTO_MENU
setopt COMPLETE_ALIASES
# Key bindings
bindkey -e
bindkey '^R' history-incremental-search-backward
# Prompt
autoload -U colors && colors
PROMPT='%{$fg[cyan]%}%n@%m%{$reset_color%}:%{$fg[yellow]%}%~%{$reset_color%}$ '
# Aliases
alias ll='ls -la'
alias la='ls -a'
alias l='ls -CF'
alias grep='grep --color=auto'
alias ..='cd ..'
alias ...='cd ../..'
# Git aliases
alias g='git'
alias gs='git status'
alias ga='git add'
alias gc='git commit'
alias gp='git push'
alias gl='git log --oneline'
alias gd='git diff'
# Tmux aliases
alias t='tmux'
alias ta='tmux attach'
alias tl='tmux list-sessions'
# Functions
mkcd() {
mkdir -p "$1" && cd "$1"
}
# Load local zshrc if exists
[[ -f ~/.zshrc.local ]] && source ~/.zshrc.local
# Environment variables
export EDITOR=nvim
export VISUAL=nvim
export PAGER=less
export LESS='-R'
# Path additions
export PATH="$PATH:$HOME/.local/bin"
export PATH="$PATH:$HOME/bin"