最終ゴール
- Neovimのインストール
- プラグインの設定
- githubに設定ファイルをおいて、いつでも自分の設定にできる
- linuxでも、自分設定で使えるようにする
この記事
- Neovimのインストール
- deinの導入設定
前提
- vagrant + virtualboxにて仮想CentOS7.2の構築
zシェルのインストール
sudo yum -y install zsh
chsh -s /bin/zsh
cp ../../vagrant_data/.zshrc .zshrc
この時、.zshrcの設定もする。
ここでログアウトしてから、再度入る。
gitインストール
sudo yum -y install git
Neovimのインストール
sudo yum install -y epel-release
sudo yum install -y python34-setuptools
sudo easy_install-3.4 pip
sudo curl -o /etc/yum.repos.d/dperson-neovim-epel-7.repo https://copr.fedorainfracloud.org/coprs/dperson/neovim/repo/epel-7/dperson-neovim-epel-7.repo
sudo yum -y install neovim
pip3 install --upgrade neovim
upgrade時にエラーが出るが放置でOK
deinの設定
mkdir ~/.cache/dein
~/.cache/dein
curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
sh ./installer.sh ~/.cache/dein
プラグインのインストール
export XDG_CONFIG_HOME="$HOME/.config"
mkdir $XDG_CONFIG_HOME
mkdir nvim
cp ../../../vagrant_data/init.vim nvim/
mkdir dein
cp ../../../vagrant_data/dein.toml dein/
cp ../../../vagrant_data/dein_lazy.toml dein/
# $XDG_CONFIG_HOME/nvim/init.vim
let g:cache_home = empty($XDG_CACHE_HOME) ? expand('$HOME/.cache') : $XDG_CACHE_HOME
let g:config_home = empty($XDG_CONFIG_HOME) ? expand('$HOME/.config') : $XDG_CONFIG_HOME
" dein {{{
let s:dein_cache_dir = g:cache_home . '/dein'
" reset augroup
augroup MyAutoCmd
autocmd!
augroup END
if &runtimepath !~# '/dein.vim'
let s:dein_repo_dir = s:dein_cache_dir . '/repos/github.com/Shougo/dein.vim'
" Auto Download
if !isdirectory(s:dein_repo_dir)
call system('git clone https://github.com/Shougo/dein.vim ' . shellescape(s:dein_repo_dir))
endif
" dein.vim をプラグインとして読み込む
execute 'set runtimepath^=' . s:dein_repo_dir
endif
" dein.vim settings
let g:dein#install_max_processes = 16
let g:dein#install_progress_type = 'title'
let g:dein#install_message_type = 'none'
let g:dein#enable_notification = 1
if dein#load_state(s:dein_cache_dir)
call dein#begin(s:dein_cache_dir)
let s:toml_dir = g:config_home . '/dein'
call dein#load_toml(s:toml_dir . '/dein.toml', {'lazy': 0})
call dein#load_toml(s:toml_dir . '/dein_lazy.toml', {'lazy': 1})
if has('nvim')
" call dein#load_toml(s:toml_dir . '/neovim.toml', {'lazy': 1})
endif
call dein#end()
call dein#save_state()
endif
if has('vim_starting') && dein#check_install()
call dein#install()
endif
" }}}
- neovimの起動
nvim
- 権限エラーが出た場合
sudo chown -R vagrant .cache/