diff options
author | katherine <shmibs@shmibbles.me> | 2016-05-05 04:13:10 -0700 |
---|---|---|
committer | katherine <shmibs@shmibbles.me> | 2016-05-05 04:13:10 -0700 |
commit | 0f8944cc477048035cc77a6d0274df12c5fcb5ba (patch) | |
tree | 6c2f5c9ff15ba8b6a5d0a841943608af3c794058 | |
parent | 89fa5263ceed849bdc7681b5cbd9c844bfd774be (diff) | |
download | dotfiles-0f8944cc477048035cc77a6d0274df12c5fcb5ba.tar.gz |
wrong file commited
wooooooow X_X
-rw-r--r-- | .zshrc-linux | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/.zshrc-linux b/.zshrc-linux index b5de6cd..16d4add 100644 --- a/.zshrc-linux +++ b/.zshrc-linux @@ -29,6 +29,21 @@ b2h() { echo "${val}${suffixes[$sindex]}" } +if [[ $(whence fzf) ]]; then + f() { + local file + fzf --color=16 --black \ + --bind=ctrl-b:page-up,ctrl-f:page-down \ + | read file + + [[ -z "$file" ]] && return + + [[ $(xclip -o 2>/dev/null) ]] || { echo "${file:a}"; return } + + echo "${file:a}" | xclip -i -selection clipboard + } +fi + # ignore non-tracked files git() { if [[ $# -gt 0 ]] && [[ "$1" == "status" ]]; then |