diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc index 776ab37..9139524 100644 --- a/.config/zsh/.zshrc +++ b/.config/zsh/.zshrc @@ -66,9 +66,13 @@ zsh_add_file "zsh-vim-mode" zsh_add_file "zsh-aliases" zsh_add_file "zsh-prompt" zsh_add_file "zsh-directories" +zsh_add_file "zsh-fzf" +# Change the zsh completion description color (use escape codes for the ansi colors instead of %F{blue}) +# https://github.com/marlonrichert/zsh-autocomplete/issues/654 # zstyle ':completion:*:*:*:*:descriptions' format '%F{blue}-- %D %d --%f' # zstyle ':completion:*:*:descriptions' format '%F{blue}%d%f' +zstyle ':completion:*:*:descriptions' format $'\033[1;34m%d\033[0m' # Plugins # zsh_add_plugin "zsh-users/zsh-autosuggestions" @@ -106,14 +110,6 @@ bindkey "^j" down-line-or-beginning-search # Down bindkey -r "^u" bindkey -r "^d" -# FZF -[ -f /usr/share/fzf/completion.zsh ] && source /usr/share/fzf/completion.zsh -[ -f /usr/share/fzf/key-bindings.zsh ] && source /usr/share/fzf/key-bindings.zsh -[ -f /usr/share/doc/fzf/examples/completion.zsh ] && source /usr/share/doc/fzf/examples/completion.zsh -[ -f /usr/share/doc/fzf/examples/key-bindings.zsh ] && source /usr/share/doc/fzf/examples/key-bindings.zsh -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh -[ -f $ZDOTDIR/completion/_fnm ] && fpath+="$ZDOTDIR/completion/" - # Edit line in nvim/hx with ctrl-e: autoload edit-command-line; zle -N edit-command-line bindkey '^e' edit-command-line diff --git a/.config/zsh/zsh-fzf b/.config/zsh/zsh-fzf new file mode 100644 index 0000000..7c42039 --- /dev/null +++ b/.config/zsh/zsh-fzf @@ -0,0 +1,47 @@ +# fzf +export FZF_DEFAULT_COMMAND='rg --files --hidden --glob "!.git"' +export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" + +FZF_COLORS="bg+:-1,\ +fg:white,\ +fg+:white,\ +border:black,\ +spinner:0,\ +hl:yellow,\ +header:blue,\ +info:green,\ +pointer:red,\ +marker:blue,\ +prompt:gray,\ +hl+:red" + +export FZF_DEFAULT_OPTS="--height 60% \ +--border sharp \ +--layout reverse \ +--color '$FZF_COLORS' \ +--prompt '∷ ' \ +--pointer ▶ \ +--marker ⇒" +export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -n 10'" +export FZF_COMPLETION_DIR_COMMANDS="cd pushd rmdir tree ls" + + + +# Sourching fzf for zsh +[ -f /usr/share/fzf/completion.zsh ] && source /usr/share/fzf/completion.zsh +[ -f /usr/share/fzf/key-bindings.zsh ] && source /usr/share/fzf/key-bindings.zsh +[ -f /usr/share/doc/fzf/examples/completion.zsh ] && source /usr/share/doc/fzf/examples/completion.zsh +[ -f /usr/share/doc/fzf/examples/key-bindings.zsh ] && source /usr/share/doc/fzf/examples/key-bindings.zsh +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh +[ -f $ZDOTDIR/completion/_fnm ] && fpath+="$ZDOTDIR/completion/" + + +# fzf (from agile steel) +export FZF_DEFAULT_COMMAND='fd --type f --color=never --hidden' +export FZF_DEFAULT_OPTS='--no-height --color=bg+:#343d46,gutter:-1,pointer:#ff3c3c,info:#0dbc79,hl:#0dbc79,hl+:#23d18b' + +export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" +export FZF_CTRL_T_OPTS="--preview 'bat --color=always --line-range :50 {}'" + +export FZF_ALT_C_COMMAND='fd --type d . --color=never --hidden' +export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -50'" diff --git a/.zshenv b/.zshenv index 4766d97..209eef3 100644 --- a/.zshenv +++ b/.zshenv @@ -46,33 +46,6 @@ export HISTSIZE=10000 # Maximum events for internal history export SAVEHIST=10000 # Maximum events in history file export HISTORY_IGNORE="(ls|cd|pwd|exit|sudo reboot|history|cd -|cd ..)" -# fzf -export FZF_DEFAULT_COMMAND='rg --files --hidden --glob "!.git"' -export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" - -FZF_COLORS="bg+:-1,\ -fg:white,\ -fg+:white,\ -border:black,\ -spinner:0,\ -hl:yellow,\ -header:blue,\ -info:green,\ -pointer:red,\ -marker:blue,\ -prompt:gray,\ -hl+:red" - -export FZF_DEFAULT_OPTS="--height 60% \ ---border sharp \ ---layout reverse \ ---color '$FZF_COLORS' \ ---prompt '∷ ' \ ---pointer ▶ \ ---marker ⇒" -export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -n 10'" -export FZF_COMPLETION_DIR_COMMANDS="cd pushd rmdir tree ls" - # lf icons export LF_ICONS="\ tw=:\