diff --git a/config/.zshrc b/config/.zshrc new file mode 100644 index 0000000..e06c4ba --- /dev/null +++ b/config/.zshrc @@ -0,0 +1,61 @@ +# Starship +eval "$(starship init zsh)" + +#Animated fetch +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}' + +alias 01= 'ssh root@192.168.10.190' +alias 02= 'ssh root@192.168.10.108' + +# Set up fzf key bindings and fuzzy completion +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 +} + + + + +alias reload-zsh="source ~/.zshrc" +alias edit-zsh="vim ~/.zshrc"