Neovim のインストール on RHEL 7 / CentOS 7 あと dein.vim とか
Neovim のインストール
Neovim 用の yum リポジトリー登録
$ sudo vi /etc/yum.repos.d/neovim.repo
[dperson-neovim] name=Copr repo for neovim owned by dperson baseurl=https://copr-be.cloud.fedoraproject.org/results/dperson/neovim/epel-7-$basearch/ skip_if_unavailable=True gpgcheck=1 gpgkey=https://copr-be.cloud.fedoraproject.org/results/dperson/neovim/pubkey.gpg enabled=1 enabled_metadata=1
$ sudo yum install neovim
$ vi ~/.bashrc
alias vi='/bin/nvim'
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
以下を ~/.vimrc or init.vim に貼り付け
"dein Scripts----------------------------- if &compatible set nocompatible " Be iMproved endif " Required: set runtimepath+=/home/ユーザー名/.cache/dein/repos/github.com/Shougo/dein.vim " Required: call dein#begin('/home/ユーザー名/.cache/dein') " 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') " You can specify revision/branch/tag. call dein#add('Shougo/vimshell', { 'rev': '3787e5' }) " 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-------------------------
初回起動
$ vi -u ~/.vimrc or ~/.init.vim
:call dein#install()
.vimrc カスタマイズ
以下のように .vimrc をカスタマイズ
$ vi ~/.vimrc
"dein Scripts----------------------------- if &compatible set nocompatible " Be iMproved endif " Required: set runtimepath+=/home/ユーザー名/.cache/dein/repos/github.com/Shougo/dein.vim " Required: call dein#begin('/home/ユーザー名/.cache/dein') " 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('vim-scripts/bash-support.vim') call dein#add('tomasr/molokai') call dein#add('cseelus/vim-colors-lucid') " You can specify revision/branch/tag. call dein#add('Shougo/vimshell', { 'rev': '3787e5' }) " 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------------------------- " color scheme colorscheme molokai " syntax syntax enable " ---------- 基本設定 ---------- syntax enable " 構文ハイライト有効化 set number " 行番号表示 set showmatch " 対応括弧強調表示 set backspace=indent,eol,start " backspaceを有効化 " ---------- タブ設定 ---------- set expandtab " ソフトタブ有効化 set tabstop=4 " タブ文字幅はスペース 4 つ set softtabstop=4 " ソフトタブ幅はスペース 4 つ " set shiftwidth=4 " 自動で挿入されるインデントのスペース幅 " ---------- インデント ---------- " set autoindent " 改行時自動インデント set noautoindent " display settings set number set ruler set list " encoding set encoding=utf8 set fileencoding=utf8 " cursor set cursorline set cursorcolumn
設定ファイルのコンバート
$ mkdir ~/.config
$ mkdir ~/.vim
$ ln -s ~/.vim ~/.config/nvim
$ ln -s ~/.vimrc ~/.config/nvim/init.vim
以上です!! 快適な Vim ライフを!!
追記 自分用メモ
原因が分からないのだが,カラースキーマ molokai が使えなくなることがあった.
" colorscheme molokai colorscheme elflord
などとし,一旦別のカラースキーマを設定し,再度 molokai に戻すと直った.
エラーメッセージが埋もれてしまったので正確な原因は不明だが dein#recache_runtimepath()
を実行すればよかったのかもしれない.