export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="arrow"
# update automatically without asking
zstyle ':omz:update' mode auto
zstyle ':omz:update' frequency 13
COMPLETION_WAITING_DOTS="true"
plugins=(
git
zsh-syntax-highlighting
fzf
ssh-agent
brew
)
source
$ZSH/oh-my-zsh.sh
fpath =~/.zfunc
autoload -U compinit; compinit
export EDITOR='nvim'
alias zshconfig="nvim ~/.zshrc"
alias ohmyzsh="nvim ~/.oh-my-zsh"
alias sshconfig="nvim ~/.ssh/config"
alias kittyconfig="nvim ~/.config/kitty/kitty.conf"
alias av="source .venv/bin/activate"
alias dv="deactivate"
autoload -Uz compinit
zstyle ':completion:*' menu select
#----- Use fd instead of fzf -----
export FZF_DEFAULT_COMMAND="fd --hidden --strip-cwd-prefix --exclude .git"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="fd --type=d --hidden --strip-cwd-prefix --exclude .git"
_fzf_compgen_path() {
fd --hidden --exclude .git . "$1"
}
# script to enable fzf completion for git
source ~/fzf-git.sh/fzf-git.sh
# Use fd to generate list for directory completion
_fzf_compgen_dir() {
fd --type=d --hidden --exclude .git . "$1"
}
show_file_or_dir_preview="if [ -d {} ]; then eza --tree --color=always {} | head -200; else bat -n --color=always --line-range :500 {}; fi"
export FZF_CTRL_T_OPTS="--preview 'bat -n --color=always --line-range :500 {}'"
export FZF_ALT_C_OPTS="--preview 'eza --tree -color=always {} | head -200'"
_fzf_comprun() {
local command=$1
shift
case "$command" in
cd) fzf --preview 'eza --tree --color=always {} | head -200' "$@" ;;
export|unset) fzf --preview "eval 'echo ${}'" "$@" ;;
ssh) fzf --preview 'dig {}' "$@" ;;
*) fzf --preview "$show_file_or_dir_preview" "$@" ;;
esac
}
# ----- Eza config -----
alias ls="eza --color=auto --long --git --no-filesize --icons=always --no-time --no-user --no-permissions"
# change colors using vivid
LS_COLORS=$(vivid generate zenburn)
# ----- zoxide config -----
eval "$(zoxide init zsh)"
export LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.1/lib/pkgconfig"
# starship
eval "$(starship init zsh)"