作業前の状況
- brew で Vim をインストール済み
- 今まで、Mac の Vim では .vimrc 未作成
- 今まで、Mac の Vim ではプラグイン未使用
参考ページ
dein.vim インストール
mkdir -p ~/.cache/dein cd ~/.cache/dein curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh sh ./installer.sh ~/.cache/dein
dein.vim インストール時の出力
$ sh ./installer.sh ~/.cache/dein
Install to "/Users/oki2a24/.cache/dein/repos/github.com/Shougo/dein.vim"...
git is /usr/local/bin/git
Begin fetching dein...
Cloning into '/Users/oki2a24/.cache/dein/repos/github.com/Shougo/dein.vim'...
remote: Counting objects: 4478, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 4478 (delta 8), reused 15 (delta 6), pack-reused 4458
Receiving objects: 100% (4478/4478), 858.67 KiB | 353.00 KiB/s, done.
Resolving deltas: 100% (2572/2572), done.
Done.
Please add the following settings for dein to the top of your vimrc (Vim) or init.vim (NeoVim) file:
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
set runtimepath+=/Users/oki2a24/.cache/dein/repos/github.com/Shougo/dein.vim
" Required:
if dein#load_state('/Users/oki2a24/.cache/dein')
call dein#begin('/Users/oki2a24/.cache/dein')
" Let dein manage dein
" Required:
call dein#add('/Users/oki2a24/.cache/dein/repos/github.com/Shougo/dein.vim')
" Add or remove your plugins here:
call dein#add('Shougo/neosnippet.vim')
call dein#add('Shougo/neosnippet-snippets')
" You can specify revision/branch/tag.
call dein#add('Shougo/vimshell', { 'rev': '3787e5' })
" Required:
call dein#end()
call dein#save_state()
endif
" 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
"End dein Scripts-------------------------
Done.
Complete setup dein!
$
.vimrc 作成と dein.vim 設定貼り付け
さきほど出力された内容で、
“dein Scripts—————————–
から
“End dein Scripts————————-
までをそのまま変更しないで .vimrc に貼り付けました。
vim ~/.vimrc
dein インストールの確認
vim で再起動し、次のコマンドでエラーとならなければ OK
:call dein#install()
さらに、次のコマンドでヘルプが表示され、プラグインがダウンロードされたことを確認しました。
:help neosnippet
おわりに
次は TOML ファイルでプラグインを管理するように変更など、.vimrc に手を加えていく予定です。
以上です。

「【Mac】【Vim】dein.vim でプラグイン管理する。そしてはじめて .vimrc を作る」への1件の返信
[…] 【Mac】【Vim】dein.vim でプラグイン管理する。そしてはじめて .vimrc を作る – oki2a24 に引き続き、dein.vim に関して .vimrc を修正しました。 […]