105 lines
3.4 KiB
Bash
105 lines
3.4 KiB
Bash
# --- STARSHIP ---
|
|
eval "$(starship init zsh)"
|
|
|
|
|
|
# --- ANIFETCH ---
|
|
## alias anifetch='script -q /dev/null python3 ~/.config/anifetch/anifetch.py ~/.config/anifetch/mxlabs_anim.mp4 -r 10 -W 80 -H 100 -c "--symbols braille --fg-only" -ff'
|
|
##. "$HOME/.cargo/env"
|
|
## alias afk='script -q /dev/null python3 ~/.config/anifetch/anifetch.py ~/.config/anifetch/mxlabs_anim.mp4 -r 10 -W 80 -H 100 -c "--symbols braille --fg-only" -ff'
|
|
##. "$HOME/.cargo/env"
|
|
|
|
|
|
# --- EZA ALIASES ---
|
|
TREE_IGNORE="cache|log|logs|node_modules|vendor"
|
|
alias ls=' eza --icons --group-directories-first'
|
|
alias la=' ls -a --icons'
|
|
alias ll=' ls --git -l --icons'
|
|
alias lt=' ls --icons --tree -D -L 2 -I ${TREE_IGNORE}'
|
|
alias ltt=' ls --icons --tree -D -L 3 -I ${TREE_IGNORE}'
|
|
alias lttt=' ls --icons --tree -D -L 4 -I ${TREE_IGNORE}'
|
|
alias ltttt=' ls --icons --tree -D -L 5 -I ${TREE_IGNORE}'
|
|
|
|
|
|
# --- FZF ---
|
|
eval "$(fzf --zsh)"
|
|
# --- setup fzf theme ---
|
|
fg="#cdd6f4"
|
|
bg="#1e1e2e"
|
|
bg_highlight="#143652"
|
|
purple="#cba6f7"
|
|
blue="#89b4fa"
|
|
cyan="#94e2d5"
|
|
export FZF_DEFAULT_OPTS="--color=fg:${fg},bg:${bg},hl:${purple},fg+:${fg},bg+:${bg_highlight},hl+:${purple},info:${blue},prompt:${cyan},pointer:${cyan},marker:${cyan},spinner:${cyan},header:${cyan}"
|
|
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 '$show_file_or_dir_preview'"
|
|
export FZF_ALT_C_OPTS="--preview 'eza --tree --color=always {} | head -200'"
|
|
# Advanced customization of fzf options via _fzf_comprun function
|
|
# - The first argument to the function is the name of the command.
|
|
# - You should make sure to pass the rest of the arguments to fzf.
|
|
_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
|
|
}
|
|
|
|
|
|
# --- ZINIT ---
|
|
# Set the directory we want to store zinit and plugins
|
|
ZINIT_HOME="${HOME}/.config/zinit/zinit.git"
|
|
# Download Zinit, if it's not there yet
|
|
if [ ! -d "$ZINIT_HOME" ]; then
|
|
mkdir -p "$(dirname $ZINIT_HOME)"
|
|
git clone https://github.com/zdharma-continuum/zinit.git "$ZINIT_HOME"
|
|
fi
|
|
# Source/Load zinit
|
|
source "${ZINIT_HOME}/zinit.zsh"
|
|
# Add in zsh plugins
|
|
zinit light zsh-users/zsh-syntax-highlighting
|
|
zinit light zsh-users/zsh-completions
|
|
zinit light zsh-users/zsh-autosuggestions
|
|
zinit light Aloxaf/fzf-tab
|
|
# Load completions
|
|
autoload -Uz compinit && compinit
|
|
|
|
#--- History ---
|
|
HISTSIZE=5000
|
|
HISTFILE=~/.zsh_history
|
|
SAVEHIST=$HISTSIZE
|
|
HISTDUP=erase
|
|
setopt appendhistory
|
|
setopt sharehistory
|
|
setopt hist_ignore_space
|
|
setopt hist_ignore_all_dups
|
|
setopt hist_save_no_dups
|
|
setopt hist_ignore_dups
|
|
setopt hist_find_no_dups
|
|
|
|
|
|
# Completion styling
|
|
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
|
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
|
|
zstyle ':completion:*' menu no
|
|
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
|
|
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
|
|
|
|
|
|
# --- KEYBINDS ---
|
|
bindkey '^f' autosuggest-accept
|
|
bindkey '^p' history-search-backward
|
|
bindkey '^n' history-search-forward
|
|
|
|
|
|
# --- ALIASES ---
|
|
alias reload-zsh="source ~/.zshrc"
|
|
alias edit-zsh="vim ~/.zshrc"
|
|
|
|
|
|
# --- END OF CONFIG ---
|
|
# last edited 280326
|