diff --git a/config/.zshrc b/config/.zshrc index e06c4ba..6540615 100644 --- a/config/.zshrc +++ b/config/.zshrc @@ -1,15 +1,16 @@ -# Starship +# --- STARSHIP --- eval "$(starship init zsh)" -#Animated fetch + +# --- 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" +# --- 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' @@ -18,12 +19,9 @@ 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}' -alias 01= 'ssh root@192.168.10.190' -alias 02= 'ssh root@192.168.10.108' -# Set up fzf key bindings and fuzzy completion +# --- FZF --- eval "$(fzf --zsh)" - # --- setup fzf theme --- fg="#cdd6f4" bg="#1e1e2e" @@ -31,14 +29,10 @@ 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. @@ -55,7 +49,56 @@ _fzf_comprun() { } +# --- 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