LoginSignup
1
2

More than 5 years have passed since last update.

Vimにプロジェクトツリーを追加する。(mac)

Last updated at Posted at 2019-04-18

vimってプロジェクトツリーを見ることできないのかなーと思って調べていたんですが、できるみたいなので早速導入。
今回はNERDTreeというプラグインを使用しました。

基本的にはこちらの方の記事を参考にさせて頂きました。
https://qiita.com/zwirky/items/0209579a635b4f9c95ee
ただ、一部うまくいかなかった部分があるのでメモ置き。

1, NEOBUNDLEのインストール

$ curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh

2, ~/.vimrcに以下を記述。

set nocompatible
filetype off

if has('vim_starting')
    set runtimepath+=~/.vim/bundle/neobundle.vim
    call neobundle#rc(expand('~/.vim/bundle/'))
endif

"insert here your Neobundle plugins"
NeoBundle 'scrooloose/nerdtree'

filetype plugin indent on

3, バンドルインストール

:NeoBundleInstall

ここまでやっていけると思ったんですが、vimを開こうと思ったら以下のようなメッセージが表示されました。

[neobundle] neobundle#rc() is removed function.
[neobundle] Please use neobundle#begin()/neobundle#end() instead.
[neobundle] neobundle directory is empty.
[neobundle] `NeoBundle` commands must be executed within a neobundle#begin/end block.  Please check your usage.

要は
「neobundle#rc()って書き方は止めたから、代わりに#begin()/neobundle#end()って書き方でやってくれよ。あと、NeoBundleコマンドはその中に記述してね」
ってことらしい。

なので、2の記述を以下に変更

set nocompatible
filetype off

if has('vim_starting')
    set runtimepath+=~/.vim/bundle/neobundle.vim
    call neobundle#begin(expand('~/.vim/bundle/'))
      NeoBundle 'scrooloose/nerdtree'
    call neobundle#end()
endif
filetype plugin indent on

これで再度vimを開き、:NERDTreeToggleと入力したら表示されるようになりました。

1
2
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
1
2