LoginSignup
316

More than 5 years have passed since last update.

NeoBundleを用いたVimプラグイン管理と色設定メモ

Last updated at Posted at 2014-03-30

PureなVim人間だったが今更ながらプラグイン使いたくなりNeoBundle導入したのでそのメモ

NeoBundleのダウンロードと設置

# 配置先のディレクトリを作成
$ mkdir -p ~/.vim/bundle
# NeoBundleをリポジトリから取得
$ git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim

NeoBundle導入

NeoBundleを設定する(.vimrc)

$ vim ~/.vimrc
# 以下を追記
set nocompatible
filetype plugin indent off

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

NeoBundleFetch 'Shougo/neobundle.vim'

# 以下は必要に応じて追加
NeoBundle 'Shougo/unite.vim'
NeoBundle 'Shougo/neosnippet.vim'

filetype plugin indent on

プラグインインストール

.vimrcに追記したあとで以下を実行

:NeoBundleInstall

プラグインアップデート

:NeoBundleUpdate

プラグイン削除

.vimrcの記述を削除したあとで以下を実行

:NeoBundleClean

ColorSchema導入

NeoBundleを導入すればカラースキーマも簡単にインストールできちゃいます。

カラースキーマの選別

以下でよさ気なものを選別してきます。

Vim Color Scheme Advent Calendar

Vim Colorscheme Gallery

カラースキーマのインストール設定(.vimrc)

$ vim ~/.vimrc
" solarized
NeoBundle 'altercation/vim-colors-solarized'
" mustang
NeoBundle 'croaker/mustang-vim'
" jellybeans
NeoBundle 'nanotech/jellybeans.vim'
" molokai
NeoBundle 'tomasr/molokai'

NeoBundle 'Shougo/unite.vim'
NeoBundle 'ujihisa/unite-colorscheme'
:NeoBundleInstall 

カラースキーマ表示確認

:Unite colorscheme -auto-preview

カーソルを動かせばすぐにプレビューが見れるようになります

デフォルトカラースキーマの設定

$ vim ~/.vimrc
colorscheme <カラースキーマ名>
if &term =~ "xterm-256color" || "screen-256color"
  set t_Co=256
  set t_Sf=[3%dm
  set t_Sb=[4%dm
elseif &term =~ "xterm-color"
  set t_Co=8
  set t_Sf=[3%dm
  set t_Sb=[4%dm
endif

syntax enable
hi PmenuSel cterm=reverse ctermfg=33 ctermbg=222 gui=reverse guifg=#3399ff guibg=#f0e68c

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
316