aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/zsh-syntax-highlighting.rb
blob: 18d4cde5060562f5f0754c2ef1d1f15f9b194a4d (plain)
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
require 'formula'

class ZshSyntaxHighlighting < Formula
  homepage 'https://github.com/zsh-users/zsh-syntax-highlighting'
  url 'https://github.com/zsh-users/zsh-syntax-highlighting/archive/0.1.3.zip'
  sha1 '889b041af29ff1aab0a8e3a3b99ba24f02ddc881'

  head 'https://github.com/zsh-users/zsh-syntax-highlighting.git'

  def install
    (share/'zsh-syntax-highlighting').install Dir['*']
  end

  def caveats
    <<-EOS.undent
    To activate the syntax highlighting, add the following at the end of your .zshrc:

      source #{HOMEBREW_PREFIX}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

    You will also need to force reload of your .zshrc:

      source ~/.zshrc

    Additionally, if your receive "highlighters directory not found" error message,
    you may need to add the following to your .zshenv:

      export ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR=#{HOMEBREW_PREFIX}/share/zsh-syntax-highlighting/highlighters
    EOS
  end
end