LoginSignup
0
1

More than 5 years have passed since last update.

dein.vimからpackageへの移行手順

Last updated at Posted at 2017-12-20

概要

Vim Advent Calendar 2017 の20日目の記事を見て、移行してみました。

環境

  • windows10
  • GVIM 8.0.596

使用しているリポジトリの取得

deinでは、~/.cache/dein/repoににクローンしたGitがあるので、そこから一覧を作成します。

cd ~\.cache\dein\repos\github.com
dir /b/s/a .git > a.txt
for /f %i in (a.txt) do git --git-dir=%i remote -v >> repo.txt

後はrepo.txtgit clone {repo}できるように修正し、clone.batを作成します。

git clone https://github.com/cespare/vim-toml.git 
git clone https://github.com/vim-scripts/Align.git 
git clone https://github.com/Shougo/denite.nvim.git 
git clone https://github.com/mattn/emmet-vim.git 
git clone https://github.com/lambdalisue/gina.vim.git 
git clone https://github.com/cocopon/iceberg.vim.git 
git clone https://github.com/Shougo/neomru.vim.git 
git clone https://github.com/Shougo/neosnippet-snippets.git 
git clone https://github.com/Shougo/neosnippet.vim.git 
git clone https://github.com/fuenor/qfixgrep.git 
git clone https://github.com/cocopon/vaffle.vim.git 
git clone https://github.com/tpope/vim-fugitive.git 
git clone https://github.com/nathanaelkane/vim-indent-guides.git 
git clone https://github.com/thinca/vim-qfreplace.git 
git clone https://github.com/thinca/vim-quickrun.git 
git clone https://github.com/cespare/vim-toml.git 

リポジトリのClone

windowsでは、vimfilespackpathになります。変更する場合は、パスを追加します。

set packpath+=~/.cache/plugin/vimwork2.vim/vimfiles

vimfiles/pack/plugin/startに、作成したclone.batを配置し実行します。

設定ファイルのコピー

dein.vimでは、tomlで作成していましたのでそのまま流用します。

  1. tomlからコビーし、plugin.vimを作成する。
  2. hook_add以外の部分をコメントアウトする。

設定ファイルの読み込み

packageは、vimrcの後に設定されるので遅延させないとエラーが発生します。denite#custom#varでエラーが出て気が付きました。

autocmd VimEnter * source ~/.cache/plugin/vimwork2.vim/plugin.vim

インデントは、先に設定が必要でしたので、.vimrcに移動。

let g:indent_guides_enable_on_vim_startup=1

更新処理

git pullするバッチを作成します。vimfiles/pack/plugin/startに、pull.batを配置して実行します。せっかくなので、forを使った方法を書いておきます。

for /d %%i in (*) do git --git-dir=%%i\.git pull

参考

http://tyru.hatenablog.com/entry/2017/12/20/035142
https://qiita.com/thinca/items/cdc0169e3bcc5a55a5ba
http://h-miyako.hatenablog.com/entry/2016/02/29/211534

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1