From 85c7c435c4ab74d2839ce080e859bfc4b21250b8 Mon Sep 17 00:00:00 2001 From: katherine Date: Mon, 3 Oct 2016 03:54:11 -0700 Subject: move 'f' to init/funcs --- .config/init/funcreqs/f | 2 ++ .config/init/funcs/f | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 .config/init/funcreqs/f create mode 100755 .config/init/funcs/f (limited to '.config') diff --git a/.config/init/funcreqs/f b/.config/init/funcreqs/f new file mode 100644 index 0000000..3b0110f --- /dev/null +++ b/.config/init/funcreqs/f @@ -0,0 +1,2 @@ +func_init_prereqs=(fzf) +func_init_checks=() diff --git a/.config/init/funcs/f b/.config/init/funcs/f new file mode 100755 index 0000000..8ca8b94 --- /dev/null +++ b/.config/init/funcs/f @@ -0,0 +1,13 @@ +#!/usr/bin/env zsh +# fuzzy find with fzf + +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 -- cgit v1.2.3