Skip to content

Commit

Permalink
fixup! feat: update zsh configs
Browse files Browse the repository at this point in the history
  • Loading branch information
YasminTeles committed Jun 6, 2024
1 parent e267f82 commit 2bd524c
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,32 @@ export PYENV_ROOT="$HOME/.pyenv"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

### Bat (better cat)
export BAT_THEME=tokyonight_moon

### fzf configuration
eval "$(fzf --zsh)"

### Bat (better cat)
export BAT_THEME=tokyonight_moon
### Setup fzf previews
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
}

### List directories
alias ls="eza -a --group-directories-first --icons --color=always"
Expand Down

0 comments on commit 2bd524c

Please sign in to comment.