「neovimをMac OS XにHomebrewコマンドでインストールする」の版間の差分

提供: neovim/vim入門
移動: 案内検索
行12: 行12:
 
$ brew tap neovim/neovim
 
$ brew tap neovim/neovim
 
$ brew install neovim
 
$ brew install neovim
 +
$ brew install python3
 +
$ sudo pip3 install neovim
 +
</syntaxhighlight>
 +
python3 をインストールする理由は、 pip3 を入れて、 python の neovim をインストールするためです。
 +
== GUIのneovimのインストール==
 +
事前に Xcode.app (Xcode) のインストールが必要です。
 +
<syntaxhighlight lang="bash">
 +
brew install scons
 +
brew tap neovim/neovim
 +
brew tap rogual/neovim-dot-app
 +
sudo xcodebuild -license accept
 +
brew install neovim-dot-app
 +
</syntaxhighlight>
 +
=== Xcode がないと失敗する ===
 +
<syntaxhighlight lang="bash">
 +
% brew install neovim-dot-app           
 +
==> Installing neovim-dot-app from rogual/neovim-dot-app
 +
neovim-dot-app: A full installation of Xcode.app is required to compile this software.
 +
Installing just the Command Line Tools is not sufficient.
 +
Xcode can be installed from the App Store.
 +
Error: An unsatisfied requirement failed this build.
 +
[1]    94753 exit 1    brew install neovim-dot-app
 +
</syntaxhighlight>
 +
=== Xcode ライセンスに同意していないとダメ ===
 +
Xcode ライセンスに同意していないとエラーになります。
 +
<syntaxhighlight lang="bash">
 +
% brew install neovim-dot-app   
 +
Error: You have not agreed to the Xcode license. Please resolve this by running:
 +
  sudo xcodebuild -license accept
 +
</syntaxhighlight>
 +
=== ビルドでコケる ===
 +
なぜか、ビルドで失敗した件。
 +
<syntaxhighlight lang="bash">
 +
% brew install neovim-dot-app   
 +
Updating Homebrew...
 +
==> Auto-updated Homebrew!
 +
Updated 1 tap (homebrew/core).
 +
==> Updated Formulae
 +
bit
 +
 +
==> Installing neovim-dot-app from rogual/neovim-dot-app
 +
==> Installing dependencies for rogual/neovim-dot-app/neovim-dot-app: pkgconfig
 +
==> Installing rogual/neovim-dot-app/neovim-dot-app dependency: pkgconfig
 +
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.2.sierra.bottle.tar.gz
 +
######################################################################## 100.0%
 +
==> Pouring pkg-config-0.29.2.sierra.bottle.tar.gz
 +
  /usr/local/Cellar/pkg-config/0.29.2: 11 files, 627.1KB
 +
==> Installing rogual/neovim-dot-app/neovim-dot-app
 +
==> Downloading https://github.com/rogual/neovim-dot-app/archive/0.1.5.tar.gz
 +
==> Downloading from https://codeload.github.com/rogual/neovim-dot-app/tar.gz/0.1.5
 +
######################################################################## 100.0%
 +
==> make NVIM=/usr/local/opt/neovim/bin/nvim
 +
Last 15 lines from /Users/kaoru/Library/Logs/Homebrew/neovim-dot-app/01.make:
 +
2017-09-25 15:52:06 +0900
 +
 +
make
 +
NVIM=/usr/local/opt/neovim/bin/nvim
 +
 +
VIM=/usr/local/Cellar/neovim/0.2.0_1/share/nvim NVIM=/usr/local/opt/neovim/bin/nvim scons -Q
 +
  File "/private/tmp/neovim-dot-app-20170925-96264-9vos24/neovim-dot-app-0.1.5/SConstruct", line 14
 +
 +
    print "Unable to execute pkg-config, you may have to set CFLAGS and LDFLAGS by hand."
 +
 +
                                                                                        ^
 +
 +
SyntaxError: invalid syntax
 +
 +
make: *** [all] Error 2
 +
 +
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
 +
https://github.com/rogual/homebrew-neovim-dot-app/issues
 +
 +
These open issues may also help:
 +
VIM env var in neovim directory https://github.com/rogual/homebrew-neovim-dot-app/issues/15
 +
Python is an unnecessary dependency https://github.com/rogual/homebrew-neovim-dot-app/issues/2
 +
[1]    95565 exit 1    brew install neovim-dot-app
 +
</syntaxhighlight>
 +
=== brewのlinkappsは deprecated ===
 +
インストール方法の説明に brew linkapps って書いてあるケースがあるけど、 brew ではすでに deprecated になっている。
 +
<syntaxhighlight lang="bash">
 +
% brew linkapps neovim-dot-app 
 +
Warning: `brew linkapps` has been deprecated and will eventually be removed!
 +
 +
Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight using
 +
either aliases or symlinks and Homebrew formulae do not build "proper" `.app`
 +
bundles that can be relocated. Instead, please consider using `brew cask` and
 +
migrate formulae using `.app`s to casks.
 +
Error: No such keg: /usr/local/Cellar/neovim-dot-app
 +
[1]    95189 exit 1    brew linkapps neovim-dot-app
 
</syntaxhighlight>
 
</syntaxhighlight>
 
== 設定 ==
 
== 設定 ==
[[neovim]]の設定に関しては、[[neovimの設定ファイルとディレクトリの置き場]]をご参照ください。、
+
[[neovim]]の設定に関しては、[[neovimの設定ファイルとディレクトリの置き場]]をご参照ください。
 +
<syntaxhighlight lang="bash">
 +
mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config}
 +
ln -s ~/.vim $XDG_CONFIG_HOME/nvim
 +
ln -s ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim
 +
</syntaxhighlight>
 
== 関連項目 ==
 
== 関連項目 ==
 
* [[neovimの設定ファイルとディレクトリの置き場]]
 
* [[neovimの設定ファイルとディレクトリの置き場]]

2017年9月25日 (月) 23:35時点における版

neovimは、Mac OS XHomebrew で簡単にインストールできます

読み方

neovim
ねお ぶいあいえむ
Homebrew
ほーむぶりゅー

概要

neovimは、Mac OS X でも簡単に利用できます。

インストール

$ brew tap neovim/neovim
$ brew install neovim
$ brew install python3
$ sudo pip3 install neovim

python3 をインストールする理由は、 pip3 を入れて、 python の neovim をインストールするためです。

GUIのneovimのインストール

事前に Xcode.app (Xcode) のインストールが必要です。

brew install scons
brew tap neovim/neovim
brew tap rogual/neovim-dot-app
sudo xcodebuild -license accept
brew install neovim-dot-app

Xcode がないと失敗する

% brew install neovim-dot-app            
==> Installing neovim-dot-app from rogual/neovim-dot-app
neovim-dot-app: A full installation of Xcode.app is required to compile this software.
Installing just the Command Line Tools is not sufficient.
Xcode can be installed from the App Store.
Error: An unsatisfied requirement failed this build.
[1]    94753 exit 1     brew install neovim-dot-app

Xcode ライセンスに同意していないとダメ

Xcode ライセンスに同意していないとエラーになります。

% brew install neovim-dot-app    
Error: You have not agreed to the Xcode license. Please resolve this by running:
  sudo xcodebuild -license accept

ビルドでコケる

なぜか、ビルドで失敗した件。

% brew install neovim-dot-app    
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
bit
 
==> Installing neovim-dot-app from rogual/neovim-dot-app
==> Installing dependencies for rogual/neovim-dot-app/neovim-dot-app: pkgconfig
==> Installing rogual/neovim-dot-app/neovim-dot-app dependency: pkgconfig
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.2.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pkg-config-0.29.2.sierra.bottle.tar.gz
  /usr/local/Cellar/pkg-config/0.29.2: 11 files, 627.1KB
==> Installing rogual/neovim-dot-app/neovim-dot-app
==> Downloading https://github.com/rogual/neovim-dot-app/archive/0.1.5.tar.gz
==> Downloading from https://codeload.github.com/rogual/neovim-dot-app/tar.gz/0.1.5
######################################################################## 100.0%
==> make NVIM=/usr/local/opt/neovim/bin/nvim
Last 15 lines from /Users/kaoru/Library/Logs/Homebrew/neovim-dot-app/01.make:
2017-09-25 15:52:06 +0900
 
make
NVIM=/usr/local/opt/neovim/bin/nvim
 
VIM=/usr/local/Cellar/neovim/0.2.0_1/share/nvim NVIM=/usr/local/opt/neovim/bin/nvim scons -Q
  File "/private/tmp/neovim-dot-app-20170925-96264-9vos24/neovim-dot-app-0.1.5/SConstruct", line 14
 
    print "Unable to execute pkg-config, you may have to set CFLAGS and LDFLAGS by hand."
 
                                                                                        ^
 
SyntaxError: invalid syntax
 
make: *** [all] Error 2
 
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/rogual/homebrew-neovim-dot-app/issues
 
These open issues may also help:
VIM env var in neovim directory https://github.com/rogual/homebrew-neovim-dot-app/issues/15
Python is an unnecessary dependency https://github.com/rogual/homebrew-neovim-dot-app/issues/2
[1]    95565 exit 1     brew install neovim-dot-app

brewのlinkappsは deprecated

インストール方法の説明に brew linkapps って書いてあるケースがあるけど、 brew ではすでに deprecated になっている。

% brew linkapps neovim-dot-app   
Warning: `brew linkapps` has been deprecated and will eventually be removed!
 
Unfortunately `brew linkapps` cannot behave nicely with e.g. Spotlight using
either aliases or symlinks and Homebrew formulae do not build "proper" `.app`
bundles that can be relocated. Instead, please consider using `brew cask` and
migrate formulae using `.app`s to casks.
Error: No such keg: /usr/local/Cellar/neovim-dot-app
[1]    95189 exit 1     brew linkapps neovim-dot-app

設定

neovimの設定に関しては、neovimの設定ファイルとディレクトリの置き場をご参照ください。

mkdir -p ${XDG_CONFIG_HOME:=$HOME/.config}
ln -s ~/.vim $XDG_CONFIG_HOME/nvim
ln -s ~/.vimrc $XDG_CONFIG_HOME/nvim/init.vim

関連項目