LoginSignup
16
7

More than 5 years have passed since last update.

Macでvimのluaを有効化しようとしたら--with-luaが無いと言われた

Last updated at Posted at 2019-04-10

そもそものきっかけ

最近ずっとvimをカスタマイズしていて、
補完機能を強化するプラグインとして有名なneocompleteを入れようとした。
しかしneocompleteを使うにはluaが有効化していないと使えないらしく、
luaを有効化させたvimを入れようとした。

あとで知ったんですけどneocompleteは開発終了するらしく、
今はdeopeleteを使うのが良いそうです。

環境

macOS Mojave 10.14.4
Homebrew 2.1.0
vim 8.1.1100

やったこと

まずはluaのインスコ
$ brew install lua

次にlua付きでvimを再インスコ
$ brew reinstall vim --with-lua
↑のコマンドでエラーを吐いた

brew reinstall vim --with-lua
Usage: brew reinstall [options] formula

Uninstall and then install formula (with existing and any appended install
options).

Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will be run for the
reinstalled formulae or, every 30 days, for all formulae.

    -d, --debug                      If brewing fails, open an interactive
                                     debugging session with access to IRB or a
                                     shell inside the temporary build directory
    -s, --build-from-source          Compile formula from source even if a
                                     bottle is available.
        --force-bottle               Install from a bottle if it exists for the
                                     current or newest version of macOS, even if
                                     it would not normally be used for
                                     installation.
        --keep-tmp                   Don't delete the temporary files created
                                     during installation.
    -f, --force                      Install without checking for previously
                                     installed keg-only or non-migrated
                                     versions.
    -v, --verbose                    Print the verification and postinstall
                                     steps.
        --display-times              Print install times for each formula at the
                                     end of the run.
    -h, --help                       Show this message.
Error: invalid option: --with-lua

Error: invalid option: --with-lua // 無効なオプションって意味

?????
最近使えなくなったのかな?(要検索)

そして何を思ったのか、とりあえずvim自体をオプションなしで再インストールしてみた
$ brew reinstall vim
動いた

luaが有効化されているか確認
$ vim —version | grep lua

+lua

なんで有効化されてるの?????

原因は分からずじまい

vimのマニュアル等を少し読んでみたり、調べてみたりしましたが分かりませんでした。
--with-lua が存在しないのも謎
ただ素のvimを再インストールしただけでluaが有効化したのも謎

もしも知ってる方がいらっしゃったら教えていただけると助かります。

蛇足

$ brew reinstall vim を試すまでに3時間くらい四苦八苦してた…

追記

--with-lua のoptionが使えない理由を教えていただけました。

Homebrewではオプションを指定してパッケージをインストールしようとすると、ソースからビルドすることになってしまいます。
この不便さを解消するため、homebrew-coreの全てのformulaから、よく使われるオプションをあらかじめオンになるようにした上で全てのオプションを削除することになりました。

ありがとうございます!!

16
7
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
7