LoginSignup
185
145

More than 5 years have passed since last update.

dein.vimのインストール自体にハマってしまったメモ

Last updated at Posted at 2016-05-19

vimに興味があって、プラグインをこれから使おうとdein.vimを使おうとしたら、dein.vimのインストール自体に大分引っかかってしまったので記録として残しておきます。

公式ページ https://github.com/Shougo/dein.vim
に則ってなんとなくなにをしているのかを訳しながらいきます

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

・早速つまずいたところ。最初のコードは、「"installer.sh"という名前のファイルを作ってその中にリクエストしたURLの中身を記入して現在のディレクトリに置いておくよ」という意味だとわかったけども、そのファイルをどこに置いておくかを迷った。

・調べた結果、どうやら~/.cache/deinというところに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
#と打ってあげる

とやればうまくいきました。

・で、肝心なのはこの次で、2, Edit your .vimrc like this.の部分のようにコードをvimrcに記載してもvimrcが読み込んでくれなかった。

・質問投稿サイトで聞いてみたら、最後のコマンドを打った後に出てくるサンプルコードをしっかりコピーして使わないと.vimrcが読み込んでくれないということが判明しました

"dein Scripts-----------------------------
if &compatible
  set nocompatible               " Be iMproved
endif

" Required:
set runtimepath+=$HOME/.cache/dein/repos/github.com/Shougo/dein.vim

" Required:
if dein#load_state('$HOME/.cache/dein')
  call dein#begin('$HOME/.cache/dein')

  " Let dein manage dein
  " Required:
  call dein#add('$HOME/.cache/dein/repos/github.com/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/deol.nvim', { 'rev': '01203d4c9' })

  " Required:
  call dein#end()
  call dein#save_state()
endif

" Required:
filetype plugin indent on
syntax enable

" If you want to install not installed plugins on startup.
if dein#check_install()
  call dein#install()
endif

"End dein Scripts-------------------------

・こんな感じのが出てくるからしっかりとコピーしてvimrcの末尾に貼っておく。

・ついでに一番最後の部分のコメントアウトを外すのも忘れない

・あとはvimを実行すれば、インストールを開始してくれるはず。

・他のプラグインを入れたいと思ったら

#省略

call dein#add('Shougo/neosnippet.vim')
call dein#add('Shougo/neosnippet-snippets')

#githubのリポジトリ名を打ち込む
call dein#add('thinca/vim-quickrun')

こんな感じでインストールできます。

教えてくださった方、ありがとうございます!

185
145
6

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
185
145