NERDTree を使う2018年6月2日 | |
はじめにVIM のブラグイン NERDTree は、VIM でディレクトリ階層のツリービューを表示させることができる。 要するに、VIM を Atom ぽくできる。じゃあ Atom 使えばいいやんという話になるが、Atom は起動が遅くてちょっと…とか、VIM のほうが使いやすい人向け。 環境Ubuntu 16.04 LTS セットアップまず、NeoBundle をインストールする。 $ curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh 以下のような出力が出てくるので、~/.vimrc の先頭にコピー & ペーストする (パスが環境によって異なるので注意)。 "NeoBundle Scripts----------------------------- if &compatible set nocompatible " Be iMproved endif " Required: set runtimepath+=/home/xxx/.vim/bundle/neobundle.vim/ " Required: call neobundle#begin(expand('/home/xxx/.vim/bundle')) " Let NeoBundle manage NeoBundle " Required: NeoBundleFetch 'Shougo/neobundle.vim' " Add or remove your Bundles here: NeoBundle 'Shougo/neosnippet.vim' NeoBundle 'Shougo/neosnippet-snippets' NeoBundle 'tpope/vim-fugitive' NeoBundle 'ctrlpvim/ctrlp.vim' NeoBundle 'flazz/vim-colorschemes' " You can specify revision/branch/tag. NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' } " Required: call neobundle#end() " Required: filetype plugin indent on " If there are uninstalled bundles found on startup, " this will conveniently prompt you to install them. NeoBundleCheck "End NeoBundle Scripts------------------------- VIM を再起動すると、NeoBundle をインストールするか聞かれるので、y を入力。 つづいて、NERDTree のセットアップ。~/.vimrc の "call neobundle#begin" と "call neobundle#end()" のあいだに以下を追加。 NeoBundle 'scrooloose/nerdtree' VIM を再起動すると NERDTree をインストールするか聞かれるので、y を入力。 使い方VIM を起動して、":NERDTreeToggle" と打つと NERDTree が起動するが、めんどくさいので、~/.vimrc で以下のように設定する。 map <C-t> :NERDTreeToggle<CR> Ctrl+T で起動するようになる。 "?" を押すとヘルプが出る。戻るにはまた "?" を押す。 参考 | |
PENGUINITIS |