+/config
my dotfiles and nix configuration
git clone https://git.julia.blue/+/config
704acd2
main
1export FZF_DEFAULT_OPTS ="--reverse --bind=ctrl-z:ignore \ 2--preview-window =down --height =60 % --inline-info \ 3--bind 'ctrl-p:change-preview-window(hidden|down)' \ 4--bind ctrl-r:first --bind alt-up:first --bind alt-down:last \ 5--bind shift-up:preview-page-up --bind shift-down:preview-page-down \ 6--bind ctrl-d:half-page-down --bind ctrl-u:half-page-up \ 7--color =bg+: #313244,spinner:#f5e0dc,header:#f38ba8 \ 8--color =fg: #cdd6f4,fg+:#cdd6f4,info:#cba6f7,pointer:#f5e0dc \ 9--color =marker: #f5e0dc,prompt:#cba6f7,hl:#f38ba8,hl+:#f38ba8 \ 10" 11export FZF_COMPLETION_DIR_COMMANDS="cd pushd rmdir j ji tree " 12 13__fzf() { 14 setopt localoptions pipefail 15 local item 16 fd -H --mount --color=always --type $1 | 17fzf --multi --height =80% --ansi \ 18--preview "~/.config/zsh/preview.sh {}" \ 19--bind "ctrl-/:reload(fd . / --mount -t$1)" \ 20--bind "ctrl-h:reload(fd . ~ -H --mount -t$1)" \ 21--bind "ctrl-w:reload(fd --mount -t$1)" | 22while read item ;do 23echo -n " ${(q)item} " # https://github.com/mvdan/sh/issues/960 24done 25local ret =$? &&echo &&return $ret 26} 27fzf-file-widget () { 28LBUFFER =" ${LBUFFER} $( __fzf f ) " 29local ret =$? &&zle reset-prompt &&return $ret 30} 31fzf-dir-widget () { 32LBUFFER =" ${LBUFFER} $( __fzf d ) " 33local ret =$? &&zle reset-prompt &&return $ret 34} 35zle -N fzf-file-widget &&bindkey '^F' fzf-file-widget 36zle -N fzf-dir-widget &&bindkey '^G' fzf-dir-widget 37 38_fzf_compgen_path () {fd -H --mount . "$1" ; } 39_fzf_compgen_dir () {fd -H --mount -td . "$1" ; } 40_fzf_comprun () { 41local command =$1 &&shift 42case "$command" in 43j) fzf --preview "eza --icons {}" " $@" ;; 44export | unset) fzf --preview "eval 'echo \$' {}" " $@" ;; 45ssh) fzf --preview 'give-me-a-ping-vasily {}; doggo --color=always {}' " $@" ;; 46*) fzf " $@" ;; 47 esac 48}