/
zsh-autosuggestions.rb
33 lines (26 loc) 路 1020 Bytes
/
zsh-autosuggestions.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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