Skip to content

Instantly share code, notes, and snippets.

@pawgajda-drs
Last active July 2, 2025 12:56
Show Gist options
  • Select an option

  • Save pawgajda-drs/13f719cb760ff4c6ef08c5a63e7bac20 to your computer and use it in GitHub Desktop.

Select an option

Save pawgajda-drs/13f719cb760ff4c6ef08c5a63e7bac20 to your computer and use it in GitHub Desktop.
export EDITOR="vim"
export VISUAL="vim"
export PATH="${PATH}:${HOME}/.tfenv/bin:${HOME}/.pulumi/bin:/usr/local/go/bin:$(go env GOPATH)/bin:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin"
typeset -U path
export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
export HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar"
export HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew/Homebrew"
#export MANPATH="/home/linuxbrew/.linuxbrew/share/man${MANPATH+:$MANPATH}:"
#export INFOPATH="/home/linuxbrew/.linuxbrew/share/info:${INFOPATH:-}"
#export GTK_IM_MODULE=ibus
#export QT_IM_MODULE=ibus
#export XMODIFIERS=@im=ibus
# Set history file
HISTFILE="${HOME}/.zsh_history"
# Set maximum history size
HISTSIZE=100000
# Set maximum history size stored in history file
SAVEHIST=100000
# Append to history instead of replacing when using multiple ssh sessions
setopt appendhistory
# Append command to history without waiting for shell to exit
setopt INC_APPEND_HISTORY
# Share history between sessions/terminals
setopt SHARE_HISTORY
# Ignore lines prefixed with '#'
setopt interactivecomments
# Ignore duplicate in history
setopt hist_ignore_dups
# Prevent record in history entry if preceding them with at least one space
setopt hist_ignore_space
# completion
autoload -Uz compinit
compinit
zstyle ':completion:*' menu select
if command -v kubectl >/dev/null 2>&1; then
source <(kubectl completion zsh)
fi
if command -v pulumi >/dev/null 2>&1; then
# pulumi gen-completion zsh > "${HOME}/.zsh/pulumi/completion.zsh"
source "${HOME}/.zsh/pulumi/completion.zsh"
fi
if command -v az >/dev/null 2>&1; then
autoload -U +X bashcompinit && bashcompinit
# wget https://raw.githubusercontent.com/Azure/azure-cli/dev/az.completion
source "${HOME}/.zsh/azure-cli/az.completion"
fi
# fzf
# [ -d /usr/share/doc/fzf/examples ] && source /usr/share/doc/fzf/examples/completion.zsh
# [ -d /usr/share/doc/fzf/examples ] && source /usr/share/doc/fzf/examples/key-bindings.zsh
# fedora handles things differently
# wget -O "${HOME}/.zsh/fzf" https://raw.githubusercontent.com/junegunn/fzf/master/shell/completion.zsh
[ -d "${HOME}/.zsh/fzf" ] && source "${HOME}/.zsh/fzf/completion.zsh"
[ -d /usr/share/fzf/shell ] && source /usr/share/fzf/shell/key-bindings.zsh
# vcs integration
autoload -Uz vcs_info
# git integration
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:git:*' stagedstr ' %F{green}●%f'
zstyle ':vcs_info:git:*' unstagedstr ' %F{red}✘%f'
zstyle ':vcs_info:git:*' formats '::%s(%F{yellow}%b%f%c%u) '
zstyle ':vcs_info:git:*' actionformats '::%s(%F{yellow}%b%f|%a%u%c) '
precmd() { vcs_info }
# kubectl prompt
# https://github.com/superbrothers/zsh-kubectl-prompt
[ -d "${HOME}/.zsh/zsh-kubectl-prompt" ] && source "${HOME}/.zsh/zsh-kubectl-prompt/kubectl.zsh"
RPROMPT='%B%F{blue}(${ZSH_KUBECTL_PROMPT})%b%f'
# prompt
setopt PROMPT_SUBST
#PROMPT_NEWLINE=$'\n%{\r%}'
PROMPT='%B%F{green}%n@%m %B%F{cyan}%~%b%f %B${vcs_info_msg_0_}%b%B%F{blue}%#%b%f '
# keybindings
bindkey -e
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
# aliases
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias zgrep='zgrep --color=auto'
alias egrep='egrep --color=auto'
alias pgrep='pgrep --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
# others
[ -f ~/.zsh.localhost ] && source ~/.zsh.localhost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment