LoginSignup
3
0

More than 5 years have passed since last update.

macOS mojaveをクリーンインストールしてからvimをビルドするまで

Last updated at Posted at 2019-01-06

年末年始にmojaveをアップデートしたときにアップデートが固まるトラブルがあり、クリーンインストールしました。
まっさらな状態からvimをビルドしたのですが、これは開発環境構築手順として便利だと思うのでまとめます。

前提

  • macOS mojave 10.14.2
  • vimのソースコードは ghq get vim/vim で取得する

手順

以下Terminal.appのコマンドライン上で実行します。

gitのインストール

xcode-select --install

homebrewのインストール

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

ghqのインストール

brew install ghq

追記:
初稿ではgo getによる方法を記載してましたが、 @EqualL2 さんのより手数の少ない手順に書き換えました。ありがとう御座います。

vimのビルド

vimをmake, make installします。
なお、vimのHEADをコマンド一発でインストールできると個人的に便利なので、以下のようにaliasを定義しています。

function makeInstallLatestVim() {
  ghq get vim/vim --update;
  pushd `ghq list vim/vim --full-path`;
  git checkout master;

  ./configure \
    --with-features=huge \
    --enable-luainterp \
    --with-lua-prefix=/usr/local \
    --enable-perlinterp \
    --enable-pythoninterp \
    --enable-python3interp \
    --enable-rubyinterp \
    --enable-fail-if-missing;

  make;
  sudo make install;
  popd
}

alias vup=makeInstallLatestVim

このaliasを使ってvimをインストールします。
LuaおよびPython3を有効にしたいため、homebrewで事前にインストールしておきます。


brew install lua
brew install python3
vup

以上です。

おまけ

自分個人のvimrcの設定手順です。

dotfilesを取得

cd ~/
git clone https://github.com/yysaki/dotfiles.git
cd dotfiles/
sh setup.sh link
git clone https://github.com/Shougo/dein.vim.git ~/.vim/dein/repos/github.com/Shougo/dein.vim

vimを起動して以下を実行:

:call dein#install()<CR>
:q<CR>

iTerm2のインストール

最初の方で引用したtweetの画像は、 iTerm2のicebergテーマを使ってスクショしています。

こちらの設定手順は割愛します。

3
0
2

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
3
0