LoginSignup
13
15

More than 5 years have passed since last update.

dein.vim を使ってみた (というかただ初期設定してみた)

Last updated at Posted at 2016-04-21

重い腰を上げて、ようやく NeoBundle から dein.vim に乗り換えてみました。

何はなくともまずはGitHub

とにかくインストールしてみよう!ってことで、下記を実行。

公式リポジトリのREADMEより
$ curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
$ sh ./installer.sh {specify the installation directory}

{specify the installation directory}の部分は何を指定したら良いんだろう?と思ったけど、たぶん$HOME/.vimでいいんじゃね?って事でこうしてみた。

こうしてみた
$ sh ./installer.sh $HOME/.vim
こんな風になった
$ sh ./installer.sh $HOME/.vim
Install to "/home/vagrant/.vim/repos/github.com/Shougo/dein.vim"...

git is /usr/bin/git

Begin fetching dein...
Initialized empty Git repository in /home/vagrant/.vim/repos/github.com/Shougo/dein.vim/.git/
remote: Counting objects: 2931, done.
remote: Compressing objects: 100% (72/72), done.
Receiving objects: 100% (2931/2931), 465.40 KiB | 166 KiB/s, done.
remote: Total 2931 (delta 36), reused 0 (delta 0), pack-reused 2853
Resolving deltas: 100% (1690/1690), done.
Done.

Please add the following settings for dein to the top of your vimrc (Vim) or init.vim (NeoVim) file:


"dein Scripts-----------------------------
(略)
"End dein Scripts-------------------------


Done.
Complete setup dein!

ちなみにワンライナーでこんな風にも書ける。

ワンライナー
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh)" -- ~/.vim

$HOME/.vim/repos/github.com/Shougo/dein.vim ???

ん・・・? なんかやたら階層深くね?

・・・と思ったけど、どうやら$HOME/.vim/bundleの代わりが$HOME/.vim/reposって感じらしい。
reposの配下はリポジトリURLに対応する感じなのね。なるほどね。

$HOME/.vimrc

というわけで、うちの$HOME/.vimrcはこんな風にしてみました。

$HOME/.vimrc
"dein Scripts-----------------------------
if &compatible
    set nocompatible " Be iMproved
endif

" Required:
set runtimepath^=~/.vim/repos/github.com/Shougo/dein.vim

" Required:
call dein#begin(expand('~/.vim'))

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

if filereadable(expand('~/.vimrc.dein'))
    source ~/.vimrc.dein
endif

" Required:
call dein#end()

" Required:
filetype plugin indent on

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

"End dein Scripts-------------------------

runtime! conf.d/.vimrc.*
if filereadable(expand('~/.vimrc.local'))
    source ~/.vimrc.local
endif

dein.vim で管理したいプラグインは $HOME/.vimrc.dein に追記していく感じで。

13
15
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
13
15