5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

deinに乗り換えよう(第二段階)

Last updated at Posted at 2016-12-17

前提条件

  • MacOS ElCapitan 10.11.6
  • vim8.0
  • homebrew

今回の作業

さて先日導入したdein.vim
プラグインを管理するためなので、次はプラグインを入れていく作業
まずは

  • neocomplete
  • nerdtree

から。ついでにdein.vimを自動で入れる記述も追加。

手順

neocomplete

neosnippetは最初に入れたので、次はneocomplete(スニペットの補完)

$ vi .vimrc
・・・略
call dein#add('Shougo/neosnippet-snippets')
call dein#add('Shougo/neocomplete.vim')
・・・略

で、もう一度viを開くと

[dein] Not installed plugins: ['neocomplete.vim']
[dein] Update started: (2016/12/17 14:39:44)
[dein] (1/1) |neocomplete.vim     | git clone --recursive https://github.com/Shougo/neocomplete.vim.git "/Users/MineDir/.vim/dein/repos/github.com/Shougo/neocomplete.vim"
[dein] (1/1) [====================] neocomplete.vim
[dein] (1/1) |neocomplete.vim     | Updated
[dein] (1/1)  -> 9af19a78e381a13513851d222c17be1bd2679f7e
[dein] Updated plugins:
[dein]   neocomplete.vim(1 change)
[dein] Done: (2016/12/17 14:39:48)
Press ENTER or type command to continue

これ超簡単じゃないですか?!(今更)

nerdtree

次は、ファイルツリーを表示するためにnerdtree

$ vi .vimrc
・・・略
call dein#add('scrooloose/nerdtree')
・・・略

もう一度viを開き直すと

[dein] Not installed plugins: ['nerdtree']
[dein] Update started: (2016/12/17 14:48:32)
[dein] (1/1) |nerdtree            | git clone --recursive https://github.com/scrooloose/nerdtree.git "/Users/MineDir/.vim/dein/repos/github.com/scrooloose/nerdtree"
[dein] (1/1) [====================] nerdtree
[dein] (1/1) |nerdtree            | Updated
[dein] (1/1)  -> eee431dbd44111c858c6d33ffd366cae1f17f8b3
[dein] Updated plugins:
[dein]   nerdtree(1 change)
[dein] Done: (2016/12/17 14:48:36)
Press ENTER or type command to continue

これ超簡単(・・・以下略)

dein.vimの自動インストール設定

dein.vimが入ってない環境で自動的にインストールさせる設定を追加して

let s:dein_dir=expand('~/.vim/dein')
let s:dein_repo_dir=s:dein_dir . '/repos/github.com/Shougo/dein.vim'

if &compatible
  set nocompatible               " Be iMproved
endif

if !isdirectory(s:dein_repo_dir)
  execute '!git clone git@github.com:Shougo/dein.vim.git' s:dein_repo_dir
endif

" Required:
execute 'set runtimepath^=' . s:dein_repo_dir

" Required:
call dein#begin(s:dein_dir)

" Let dein manage dein
" Required:
call dein#add('Shougo/dein.vim')

" Add or remove your plugins here:
call dein#add('Shougo/neosnippet.vim')
call dein#add('Shougo/neosnippet-snippets')
call dein#add('Shougo/neocomplete.vim')
call dein#add('scrooloose/nerdtree')

" You can specify revision/branch/tag.
call dein#add('Shougo/vimshell', { 'rev': '3787e5' })

" Required:
call dein#end()

" Required:
filetype plugin indent on
syntax enable

" If you want to install not installed plugins on startup.
if dein#check_install()
  call dein#install()
endif

viをもう一度開き直して、エラーにならないのを確認。
これで他の環境でもdein入れるの超簡単(・・・以下略)

5
4
0

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
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?