のらねこの気まま暮らし

技術系だけど、Qiita向きではないポエムとかを書くめったに更新されないヤツ

homebrewでperlオプションのついたvimをインストールする術

Macでちょっと複雑な一斉置換を行いたかったのだけれど、perldoが無いって起こられたのでいろいろやった。

perlフラグが立っていない

$ vim --version | grep perl
+cmdline_compl   +insert_expand   -perl            +user_commands

perlのoptionを確認する

試しに打ってみたら、居たっぽい

$ brew options vim
--disable-nls
        Build vim without National Language Support (translated messages, keymaps)
--override-system-vi
        Override system vi
--with-client-server
        Enable client/server mode
--with-lua
        Build vim with lua support
--with-mzscheme
        Build vim with mzscheme support
--with-perl
        Build vim with perl support
--with-python3
        Build vim with python3 support
--with-tcl
        Build vim with tcl support
--without-python
        Build vim without python support
--without-ruby
        Build vim without ruby support
--HEAD
        install HEAD version

入れなおす

$ brew uninstall vim
$ brew install vim --with-perl --with-lua --override-system-vi
==> Installing vim dependency: lua
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/lua-5.1.5.mountain_lion.bottle.tar.gz
######################################################################## 100.0%
==> Pouring lua-5.1.5.mountain_lion.bottle.tar.gz
🍺  /usr/local/Cellar/lua/5.1.5: 15 files, 300K
==> Installing vim
==> Downloading http://ftp.debian.org/debian/pool/main/v/vim/vim_7.4.161.orig.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local --mandir=/usr/local/Cellar/vim/7.4.161/share/man --enable-multibyte --with-tlib=ncu
s==> make
==> make install prefix=/usr/local/Cellar/vim/7.4.161 STRIP=/usr/bin/true
🍺  /usr/local/Cellar/vim/7.4.161: 1566 files, 25M, built in 108 seconds

確認する

:perl[tab]したらperldoされて無事使えたのでこれで完了。 やっぱPerlは最高だぜ!!!!