Created
September 11, 2020 07:56
-
-
Save DreamAndDead/12ec7e972997f53481befbd111eb8d8c to your computer and use it in GitHub Desktop.
fzf config in manjaro linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export FZF_DEFAULT_OPTS='--height 100% --reverse' | |
export FZF_DEFAULT_COMMAND="fd --hidden --follow --exclude '.git' --exclude 'node_modules'" | |
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" | |
export FZF_ALT_C_COMMAND="$FZF_DEFAULT_COMMAND --type d" | |
source /usr/share/fzf/key-bindings.bash | |
source /usr/share/fzf/completion.bash | |
# https://wiki.archlinux.org/index.php/Fzf | |
fzf_install() { | |
pacman -Slq | fzf --multi --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' | xargs -ro sudo pacman -S | |
} | |
fzf_find_file() { | |
fzf --preview '([[ -f {} ]] && (bat --style=numbers --color=always {} || cat {})) || ([[ -d {} ]] && (tree -C {} | less)) || echo {} 2> /dev/null | head -200' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment