手順
neovimの導入
sudo apt install software-properties-common
sudo -E add-apt-repository ppa:neovim-ppa/unstable
sudo apt update
sudo apt install neovim
python周り
sudo apt install python3-dev python3-pip
pip3のupdate(update後、pip3はpipになります)
sudo -HE pip3 install -U pip
neovimのアップデート
sudo -HE pip install -U neovim
has('python3')の確認
nvim
nvim
:echo has('python3')
1なら成功
設定ファイルの用意
cd $HOME/.config
nvim init.vim
nvim
" 行数
set number
set noswapfile
" mapping
inoremap <silent> <C-j> <ESC>
nnoremap <silent> <Space>w :w<CR>
filetype indent on
set tabstop=4
set shiftwidth=4
set expandtab
" プラグインがインストールされるディレクトリ
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
" 設定開始
if dein#load_state(s:dein_dir)
call dein#begin(s:dein_dir)
" プラグインリストを収めた TOML ファイル
" 予め TOML ファイルを用意しておく
let g:rc_dir = expand("~/.config/nvim/")
let s:toml = g:rc_dir . '/dein.toml'
let s:lazy_toml = g:rc_dir . '/dein_lazy.toml'
" TOML を読み込み、キャッシュしておく
call dein#load_toml(s:toml, {'lazy': 0})
call dein#load_toml(s:lazy_toml, {'lazy': 1})
" 設定終了
call dein#end()
call dein#save_state()
endif
" もし、未インストールものものがあったらインストール
if dein#check_install()
call dein#install()
endif
vim dein.toml
nvim
[[plugins]]
repo = 'Shougo/deoplete.nvim'
hook_add = 'let g:deoplete#enable_at_startup = 1'
nvim dein_lazy.toml
nvim
プラグインのアップデート
nvim
nvim
:UpdateRemotePlugins
その後、mgtools/conf/rc/vim/vimrcをinit.vimにする
注意
・let.vimを環境に合わせて適宜変えてください。
例:deopleteのためのg:python3_host_progを適切なpythonバイナリのパスに合わせる、等
・deniteを使うなら、agをinstallしてください。
sudo apt -y install silversearcher-ag