2014-03-08 00:59:40 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Fzf < Formula
|
|
|
|
homepage "https://github.com/junegunn/fzf"
|
2014-05-17 16:21:59 +00:00
|
|
|
url "https://github.com/junegunn/fzf/archive/0.8.4.tar.gz"
|
|
|
|
sha1 "249d9c722ab08bd52d50a3a3b1bf843051fb94ed"
|
2014-03-08 00:59:40 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
prefix.install "install", "fzf", "fzf-completion.bash", "fzf-completion.zsh"
|
|
|
|
bin.install_symlink prefix/"fzf"
|
2014-03-30 16:07:39 +00:00
|
|
|
(prefix/"plugin").install "plugin/fzf.vim"
|
2014-03-08 00:59:40 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
To install useful keybindings and fuzzy completion:
|
|
|
|
#{prefix}/install
|
2014-03-30 16:07:39 +00:00
|
|
|
|
|
|
|
To use fzf in Vim, add the following line to your .vimrc:
|
|
|
|
set rtp+=#{prefix}
|
2014-03-08 00:59:40 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"list").write %w[hello world].join($/)
|
2014-04-05 03:02:48 +00:00
|
|
|
`cat #{testpath}/list | fzf -f wld`.chomp == "world"
|
2014-03-08 00:59:40 +00:00
|
|
|
end
|
|
|
|
end
|