From 5a13d16edd12b1eaa798f82323ef219a4883e19b Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Sun, 25 Oct 2020 21:37:12 +0100 Subject: [PATCH] More fzf magic. --- zsh/zshrc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zsh/zshrc b/zsh/zshrc index 9a86085..d88ef8e 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -21,14 +21,18 @@ if [ -f $XDG_CONFIG_HOME/fzf/fzf.zsh ]; then export FZF_TMUX_HEIGHT=60% export FZF_DEFAULT_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd' export FZF_CTRL_T_COMMAND='fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd' - export FZF_DEFAULT_OPTS="-e --multi --layout=reverse --preview='bat --color=always --tabs=2 --style=plain --theme=gruvbox {}'" - export FZF_CTRL_R_OPTS="-e --layout=reverse --preview=''" + export FZF_DEFAULT_OPTS="--multi -e --ansi --layout=reverse --preview='bat --color=always --tabs=2 --style=plain --theme=gruvbox {}'" + export FZF_CTRL_R_OPTS="-e --ansi --layout=reverse --preview=''" _fzf_compgen_path() { fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd . "$1" } _fzf_compgen_dir() { fd -H -L --ignore-file $XDG_CONFIG_HOME/local/fd --type d . "$1" } + gs() { + git -c color.status=always status --short | + fzf --ansi --preview '(git diff --color=always -- {-1} | sed 1,4d; cat {-1})' + } else zstyle ':completion:*' menu select zstyle ':completion:*' list-colors ''