【Mac】【Vim】dein.vim でプラグイン管理する。そしてはじめて .vimrc を作る – oki2a24 に引き続き、dein.vim に関して .vimrc を修正しました。
参考
を参考に dein.vim の記述を修正しました。
dein.vim に関する .vimrc の修正点まとめ
- パスを変数化した。
- vim 起動時にプラグインが導入されていなければインストールされるようにコメントを外した。
- dein.vim がなければ自動的にインストールするようにしたため、今後は dein.vim のインストールは不要となった。
- dein.vim インストール時のプラグイン例から、使いたいプラグインに記述を変更した。
dein.vim に関する .vimrc の修正内容
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" プラグインのインストール先
let s:dein_dir = expand('~/.cache/dein')
" dein.vim 本体インストール先
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'
" dein.vim がなければ github から入手
if &runtimepath !~# '/dein.vim'
if !isdirectory(s:dein_repo_dir)
execute '!git clone https://github.com/Shougo/dein.vim' s:dein_repo_dir
endif
execute 'set runtimepath^=' . fnamemodify(s:dein_repo_dir, ':p')
endif
" プラグイン設定
" Required:
if dein#load_state(s:dein_dir)
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('w0rp/ale')
call dein#add('qpkorr/vim-renamer')
call dein#add('scrooloose/nerdtree')
" 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-------------------------
おわりに
次はプラグイン部分を外部ファイル化するか、.vimrc を編集し始めましたので設定をもう少しいじってみようか、どちらかを考えています。
以上です。
