̃Gg[͂ĂȃubN}[Nɒlj

プラグイン管理:NeoBundle



プラグイン管理に neobundle.vim を導入

% mkdir -p ~/.vim/bundle
% git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim

.vimrc に下記を追記

"----------------------------------------
" plugin - NeoBundle
"----------------------------------------
set nocompatible
filetype off

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

" */* : repos on github (git://github.com/*/*.git)
NeoBundle 'Lokaltog/vim-powerline'
NeoBundle 'scrooloose/syntastic'
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'thinca/vim-quickrun'

filetype plugin indent on
filetype indent on
syntax on

「neobundle#rc() is removed function.」というエラーが発生する場合は、以下の記述に変更します。
※ このエラーは NeoBundle の仕様が変更になったことに由来するようです。

set nocompatible
filetype off
if has('vim_starting')
    set runtimepath+=~/.vim/bundle/neobundle.vim
    call neobundle#begin(expand('~/.vim/bundle/'))
    NeoBundleFetch 'Shougo/neobundle.vim'
        " */* : repos on github (git://github.com/*/*.git)
        NeoBundle 'Lokaltog/vim-powerline'
        NeoBundle 'scrooloose/syntastic'
        NeoBundle 'scrooloose/nerdtree'
        NeoBundle 'thinca/vim-quickrun'
    call neobundle#end()
endif
filetype plugin indent on
filetype indent on
syntax on

上記設定で利用可能になるプラグインは下記になります。

  • powerline
  • syntastic
  • nerdtree
  • quickrun


  • powerline の設定 (.vimrc に追記)
"----------------------------------------
" powerline
"----------------------------------------
set t_Co=256
let g:Powerline_symbols = 'compatible' "compatible unicode fancy
let g:Powerline_stl_path_style = 'relative' "filename short relative full


  • NERDTree の設定 (.vimrc に追記)
"----------------------------------------
" NERDTree
"----------------------------------------
"<C-e>でNERDTreeをオンオフ。
nmap <silent> <C-e> :NERDTreeToggle<CR>
vmap <silent> <C-e> <Esc>:NERDTreeToggle<CR>
omap <silent> <C-e> :NERDTreeToggle<CR>
imap <silent> <C-e> <Esc>:NERDTreeToggle<CR>
cmap <silent> <C-e> <C-u>:NERDTreeToggle<CR>

"無視するファイル
let g:NERDTreeIgnore=['\.clean$', '\.swp$', '\.bak$', '\~$']

"隠しファイルの表示
let g:NERDTreeShowHidden=1

"カーソルラインをハイライト表示する -> カラー表示
let g:NERDTreeHighlightCursorline=1

"ツリーを開く場所
"let g:NERDTreeWinPos="right"

"ツリーの幅
"Default: 31.
"let g:NERDTreeWinSize=45

"NERDTreeを+|`などを使ってツリー表示をする。
"ディレクトリが閉じている場合には+を先頭につける。
"ディレクトリが開いている場合には~を先頭につける。
"ファイルには-を先頭につける。
"0 : 綺麗に見せる。
"1 : +|`などを使わない
"Values: 0 or 1 (Default: 1)
let g:NERDTreeDirArrows=0



プラグインの有効化/無効化

プラグインを有効化する

vim のコマンドラインモードで「: NeoBundleInstall」を実行して、有効化します。

: NeoBundleInstall

上記コマンドは、有効化したいプラグインを .vimrc に記述してから実行します。
例えば、「syntastic」を有効化したい場合は、.vimrc の所定位置に下記が記述されている必要があります。

NeoBundle 'scrooloose/syntastic'


プラグインを無効化する

例えば、「syntastic」を無効化したい場合は、下記のように .vimrc から該当行をコメントアウトするか、または削除して

NeoBundle 'scrooloose/syntastic'

 ↓コメントアウト

" NeoBundle 'scrooloose/syntastic'

vim のコマンドラインモードで「: NeoBundleClean」を実行して、無効化します。

: NeoBundleClean


関連エントリー

    • 標準的テキストエディタ vi に「色づけ」や「スクリプト」など、機能を追加した「改良版 vi」
  1. NeoBundle
    • プラグイン管理:NeoBundle
    • プラグイン管理:pathogen





unix/command/vim/plugin/neobundle.txt