読者です 読者をやめる 読者になる 読者になる

IT練習ノート

IT関連で調べたこと(実際は嵌ったこと)を書いています。

neovimの導入

neovimbrewでインストールします。

https://github.com/neovim/neovim

foo$ brew install neovim/neovim/neovim
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, homebrew/php).
==> New Formulae
alexjs                        dmtx-utils                    gtef                          httpflow                      llvm@3.9                      teleport

...

==> Renamed Formulae
bash-completion2 -> bash-completion@2                       gsl1 -> gsl@1                                               percona-server56 -> percona-server@5.6

...

==> Tapping neovim/neovim
Cloning into '/usr/local/Homebrew/Library/Taps/neovim/homebrew-neovim'...
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 7 (delta 0), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (7/7), done.
Checking connectivity... done.
Tapped 1 formula (32 files, 35.2KB)
==> Installing neovim from neovim/neovim
==> Installing dependencies for neovim/neovim/neovim: cmake, libtool, autoconf, automake, pkg-config, jemalloc, libuv, msgpack, unibilium, libtermkey, libvterm
==> Installing neovim/neovim/neovim dependency: cmake
==> Downloading https://homebrew.bintray.com/bottles/cmake-3.7.2.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring cmake-3.7.2.yosemite.bottle.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/cmake
==> Summary
🍺  /usr/local/Cellar/cmake/3.7.2: 2,143 files, 29.3MB
==> Installing neovim/neovim/neovim dependency: libtool
==> Downloading https://homebrew.bintray.com/bottles/libtool-2.4.6_1.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libtool-2.4.6_1.yosemite.bottle.tar.gz
==> Caveats
In order to prevent conflicts with Apple's own libtool we have prepended a "g"
so, you have instead: glibtool and glibtoolize.
==> Summary
🍺  /usr/local/Cellar/libtool/2.4.6_1: 70 files, 3.7MB
==> Installing neovim/neovim/neovim dependency: autoconf
==> Downloading https://homebrew.bintray.com/bottles/autoconf-2.69.yosemite.bottle.4.tar.gz
######################################################################## 100.0%
==> Pouring autoconf-2.69.yosemite.bottle.4.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
  /usr/local/share/emacs/site-lisp/autoconf
==> Summary
🍺  /usr/local/Cellar/autoconf/2.69: 70 files, 3.0MB
==> Installing neovim/neovim/neovim dependency: automake
==> Downloading https://homebrew.bintray.com/bottles/automake-1.15.yosemite.bottle.2.tar.gz
######################################################################## 100.0%
==> Pouring automake-1.15.yosemite.bottle.2.tar.gz
🍺  /usr/local/Cellar/automake/1.15: 130 files, 2.9MB
==> Installing neovim/neovim/neovim dependency: pkg-config
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.2.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pkg-config-0.29.2.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/pkg-config/0.29.2: 11 files, 631KB
==> Installing neovim/neovim/neovim dependency: jemalloc
==> Downloading https://homebrew.bintray.com/bottles/jemalloc-4.5.0.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring jemalloc-4.5.0.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/jemalloc/4.5.0: 16 files, 1.4MB
==> Installing neovim/neovim/neovim dependency: libuv
==> Downloading https://homebrew.bintray.com/bottles/libuv-1.11.0.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libuv-1.11.0.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/libuv/1.11.0: 56 files, 2.3MB
==> Installing neovim/neovim/neovim dependency: msgpack
==> Downloading https://homebrew.bintray.com/bottles/msgpack-2.1.1.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring msgpack-2.1.1.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/msgpack/2.1.1: 662 files, 5MB
==> Installing neovim/neovim/neovim dependency: unibilium
==> Downloading https://homebrew.bintray.com/bottles/unibilium-1.2.0.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring unibilium-1.2.0.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/unibilium/1.2.0: 62 files, 271.3KB
==> Installing neovim/neovim/neovim dependency: libtermkey
==> Downloading https://homebrew.bintray.com/bottles/libtermkey-0.19.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libtermkey-0.19.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/libtermkey/0.19: 32 files, 103.8KB
==> Installing neovim/neovim/neovim dependency: libvterm
==> Downloading https://homebrew.bintray.com/bottles/libvterm-681.yosemite.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libvterm-681.yosemite.bottle.tar.gz
🍺  /usr/local/Cellar/libvterm/681: 11 files, 167.8KB
==> Installing neovim/neovim/neovim 
==> Downloading https://github.com/neovim/neovim/archive/v0.1.7.tar.gz
==> Downloading from https://codeload.github.com/neovim/neovim/tar.gz/v0.1.7
######################################################################## 100.0%
==> Downloading https://github.com/luvit/luv/archive/146f1ce4c08c3b67f604c9ee1e124b1cf5c15cf3.tar.gz
==> Downloading from https://codeload.github.com/luvit/luv/tar.gz/146f1ce4c08c3b67f604c9ee1e124b1cf5c15cf3
######################################################################## 100.0%
==> Downloading https://raw.githubusercontent.com/neovim/deps/master/opt/LuaJIT-2.0.4.tar.gz
######################################################################## 100.0%
==> Downloading https://github.com/keplerproject/luarocks/archive/5d8a16526573b36d5b22aa74866120c998466697.tar.gz
==> Downloading from https://codeload.github.com/luarocks/luarocks/tar.gz/5d8a16526573b36d5b22aa74866120c998466697
######################################################################## 100.0%
==> Building third-party dependencies.
==> cmake ../third-party -DUSE_BUNDLED_BUSTED=OFF -DUSE_BUNDLED_GPERF=OFF -DUSE_BUNDLED_LIBUV=OFF -DUSE_BUNDLED_MSGPACK=OFF -DUSE_BUNDLED_UNIBILIUM=OFF -DUSE_BUNDLED_LIBTERMKEY=O
==> make VERBOSE=1
==> Building Neovim.
==> cmake .. -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/neovim/0.1.7 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRA
==> make VERBOSE=1 install
==> Caveats
To run Neovim, use the "nvim" command (not "neovim"):
    nvim

After installing or upgrading, run the "CheckHealth" command:
    :CheckHealth

To use your existing Vim configuration:
    ln -s ~/.vim ~/.config/nvim
    ln -s ~/.vimrc ~/.config/nvim/init.vim
See ':help nvim' for more information.

Breaking changes (if any) are documented at:
    https://github.com/neovim/neovim/wiki/Following-HEAD

For other questions:
    https://github.com/neovim/neovim/wiki/FAQ
==> Summary
🍺  /usr/local/Cellar/neovim/0.1.7: 1,333 files, 16.9MB, built in 2 minutes 34 seconds
foo$ nvim
foo$ brew install neovim/neovim/neovim

設定ファイルの場所

~/.config/nvim/init.vim

記載内容は下記を参考にしてdeinを導入します。

qiita.com

導入するプラグインは下記に記述します。

/Users/foo/.dein.toml

[[plugins]]
repo = 'Shougo/dein.vim'

[[plugins]]
repo = 'Shougo/vimproc.vim'
build = 'make'

[[plugins]]
repo = 'Shougo/neosnippet-snippets'

/Users/foo/.dein_lazy.toml

[[plugins]]
repo = 'Shougo/neomru.vim'
on_path = '.*'

[[plugins]]
repo = 'jiangmiao/auto-pairs'
on_i = 1

[[plugins]]
repo = 'Shougo/neoyank.vim'
on_path = '.*'
on_i = 1

[[plugins]]
repo = 'Shougo/neosnippet'
depends = ['neosnippet-snippets']
on_i = 1
on_ft = ['snippet']

[[plugins]]
repo = 'Shougo/neocomplete'
if = 'has("lua")'
on_i = 1

[[plugins]]
repo = 'Shougo/deoplete.nvim'
if = 'has("nvim")'
on_i = 1

[[plugins]]
repo = 'Shougo/unite.vim'
depends = 'neomru.vim'

# [[plugins]]
# repo  = 'begriffs/haskell-vim-now'
# on_ft = ['haskell']

# [[plugins]]
# repo = 'neovimhaskell/haskell-vim'
# on_ft = ['haskell']

[[plugins]]
repo  = 'eagletmt/neco-ghc'
on_ft = ['haskell']

[[plugins]]
repo  = 'eagletmt/ghcmod-vim'
on_ft = ['haskell']

[[plugins]]
repo = 'scrooloose/nerdtree'

nvimを起動するとプラグインがインストールされます。

foo$ nvim ./servant03/MyWebApp1.hs 
[dein] Not installed plugins: ['ghcmod-vim']
[dein] Update started: (2017/04/02 14:45:54)

[dein] Updated plugins:
[dein]   ghcmod-vim(1 change)
[dein] Done: (2017/04/02 14:45:59)
続けるにはENTERを押すかコマンドを入力してください

インストールしたプラグインcacheに取り込まれます。

foo$ ls ~/.cache/dein/repos/github.com/
Shougo/        altercation/   begriffs/      dag/           eagletmt/
jiangmiao/     morhetz/       nanotech/      neovimhaskell/ scrooloose/
vim-scripts/
foo$ ls ~/.cache/dein/repos/github.com/