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, python3.6-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
    set nocompatible
    syntax enable
    filetype plugin indent on

deopleteを試してみる

$ vim -N -u minimal.vim

    foo
    bar
    baz

    fo  // ここでポップアップに foo [-] A , fo [-] A とでたらオーケー!
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.