Skip to content
Branch: master
Find file Copy path
Find file Copy path
1 recent contributor

Users who have contributed to this file recently

77 lines (67 sloc) 2.97 KB
class Vim < Formula
desc "Vi 'workalike' with many additional features"
homepage ""
# vim should only be updated every 50 releases on multiples of 50
url ""
sha256 "0ab3a2656f3f2a4e9b9834ce2c119aaa6c895847f7df779f3aeaa3e87f974b75"
head ""
bottle do
sha256 "88f19ef2085b516c339cbd7379191ec9e07c8ea53b136d6a0d23c48919087c5b" => :catalina
sha256 "1ed3f18174dc5eabb6be3b8deb95b2630f87657b99d5f9ebd6db718c81d37cfd" => :mojave
sha256 "f937b322f9a9eb53d1780560f916de1b04660410af5dc0fe0d175627c6e41e0c" => :high_sierra
depends_on "gettext"
depends_on "lua"
depends_on "perl"
depends_on "python"
depends_on "ruby"
conflicts_with "ex-vi",
:because => "vim and ex-vi both install bin/ex and bin/view"
conflicts_with "macvim",
:because => "vim and macvim both install vi* binaries"
def install
ENV.prepend_path "PATH", Formula["python"].opt_libexec/"bin"
# vim doesn't require any Python package, unset PYTHONPATH.
# We specify HOMEBREW_PREFIX as the prefix to make vim look in the
# the right place (HOMEBREW_PREFIX/share/vim/{vimrc,vimfiles}) for
# system vimscript files. We specify the normal installation prefix
# when calling "make install".
# Homebrew will use the first suitable Perl & Ruby in your PATH if you
# build from source. Please don't attempt to hardcode either.
system "./configure", "--prefix=#{HOMEBREW_PREFIX}",
system "make"
# Parallel install could miss some symlinks
# If stripping the binaries is enabled, vim will segfault with
# statically-linked interpreters like ruby
system "make", "install", "prefix=#{prefix}", "STRIP=#{which "true"}"
bin.install_symlink "vim" => "vi"
test do
(testpath/"commands.vim").write <<~EOS
:python3 import vim; vim.current.buffer[0] = 'hello python3'
system bin/"vim", "-T", "dumb", "-s", "commands.vim", "test.txt"
assert_equal "hello python3","test.txt").chomp
assert_match "+gettext", shell_output("#{bin}/vim --version")
You can’t perform that action at this time.