1. callmekohei

    Posted

    callmekohei
Changes in title
+Vimで単語補完 ( with deoplete )
Changes in tags
Changes in body
Source | HTML | Preview
@@ -0,0 +1,86 @@
+# Summary
+
+`Vim`で単語補完をしてみる
+
+単語補完には`deoplete`というプラグインをつかう
+
+最小(`minimal`)の環境を作ることで雰囲気をつかむ
+
+### Environment
+```
+$ sw_vers
+ProductName: Mac OS X
+ProductVersion: 10.13.4
+BuildVersion: 17E199
+
+$ vim --version
+VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 1 2018 01:22:42)
+macOS version
+Included patches: 1-1655
+Compiled by Homebrew
+
+$ pip3 --version
+pip 10.0.0 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
+
+$ pip3 show neovim
+Name: neovim
+Version: 0.2.4
+Summary: Python client to neovim
+Home-page: http://github.com/neovim/python-client
+Author: Thiago de Arruda
+Author-email: tpadilha84@gmail.com
+License: Apache
+Location: /usr/local/lib/python3.6/site-packages
+Requires: msgpack, greenlet
+Required-by:
+```
+
+### Install
+
+`vim, neovim`がなければインストールする
+
+```
+$ brew install vim
+
+$ pip3 install neovim ( or pip3 install --upgrade -I neovim )
+```
+
+`vim plugins`のインストール
+
+```
+// 作業フォルダ foo を作成
+$ mkdir foo/
+$ cd foo/
+
+// プラグインをダウンロード
+$ git clone --depth 1 https://github.com/Shougo/deoplete.nvim
+$ git clone --depth 1 https://github.com/roxma/nvim-yarp
+$ git clone --depth 1 https://github.com/roxma/vim-hug-neovim-rpc
+
+// minimal.vimを作成
+$ vim minimal.vim
+
+ set runtimepath+=./deoplete.nvim
+ set runtimepath+=./nvim-yarp
+ set runtimepath+=./vim-hug-neovim-rpc
+ let g:deoplete#enable_at_startup = 1
+ call deoplete#custom#option('deoplete-options-yarp', v:true)
+ set nocompatible
+ syntax enable
+ filetype plugin indent on
+```
+
+### `deoplete`を試してみる
+```
+$ vim -N -u minimal.vim
+
+ foo
+ bar
+ baz
+
+ fo // ここでポップアップに foo [-] A , fo [-] A とでたらオーケー!
+```
+
+
+
+