Skip to content

Instantly share code, notes, and snippets.

@DreamAndDead
Created September 11, 2020 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DreamAndDead/12ec7e972997f53481befbd111eb8d8c to your computer and use it in GitHub Desktop.
Save DreamAndDead/12ec7e972997f53481befbd111eb8d8c to your computer and use it in GitHub Desktop.
fzf config in manjaro linux
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