homebrew-core/Formula/zsh-autosuggestions.rb

34 lines
1020 B
Ruby

class ZshAutosuggestions < Formula
desc "Fish-like fast/unobtrusive autosuggestions for zsh"
homepage "https://github.com/zsh-users/zsh-autosuggestions"
url "https://github.com/zsh-users/zsh-autosuggestions/archive/v0.7.0.tar.gz"
sha256 "ccd97fe9d7250b634683c651ef8a2fe3513ea917d1b491e8696a2a352b714f08"
license "MIT"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, all: "4537653cbf3540a0785481966b36291255839f1be4012a22409ef97c46a1860b"
end
uses_from_macos "zsh" => :test
def install
pkgshare.install "zsh-autosuggestions.zsh"
end
def caveats
<<~EOS
To activate the autosuggestions, add the following at the end of your .zshrc:
source #{HOMEBREW_PREFIX}/share/zsh-autosuggestions/zsh-autosuggestions.zsh
You will also need to restart your terminal for this change to take effect.
EOS
end
test do
assert_match "history",
shell_output("zsh -c '. #{pkgshare}/zsh-autosuggestions.zsh && echo $ZSH_AUTOSUGGEST_STRATEGY'")
end
end