Neovim/Plugin/dein.vim

Neovim/Plugin/dein.vim

Install

公式を見ると

 $ curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh
 $ sh ./installer.sh {specify the installation directory}

このように書いてある。

中を読むと。そのまんま、指定したディレクトリに clone するだけなので、こいつを使ってやる

インストールするディレクトリは指定したディレクトリ以下にこのように切られるようなので

repos/github.com/Shougo/dein.vim

ここを指定する

~/.config/nvim/plugin

できたので init.vim に初期設定を書き込む

if &compatible
  set nocompatible
endif
" Required:
set runtimepath^=~/.config/nvim/plugin/repos/github.com/Shougo/dein.vim
 
" Required:
call dein#begin(expand('~/.config/nvim/plugin'))
call dein#add('Shougo/dein.vim')
call dein#end()
 
filetype plugin indent on

最低限これだけ書き込んでおく必要があるようだ

TOML ファイルでプラギン管理する

init.vim に call dein#add に続きこのように書いて読みこめばよい

call dein#load_toml('~/.config/nvim/dein.toml', {'lazy': 0})

この dein.toml には

このような形式でズラズラ書く

[[plugins]]
repo = 'Shougo/dein.vim'
 
[[plugins]]
repo = 'hoge/piyo.vim'
 
hook_add = '''
    let g:hoge_piyo_fugaaa = 1
    let g:hoge_piyo_fugaee = 2
'''

その際に設定用の vim スクリプトも書くことができて hook_add に書いておく

TOML ファイルを分割する

プラグインごとにファイルをわけて、 load_toml を必要なだけ書けばよい

起動時にインストールする

if dein#check_install()
  call dein#install()
endif
editor/vim/neovim/plugin/dein_vim.txt · 最終更新: 2020-06-26 12:03 by ore