Mac vim.ruby
今使っている vim で ruby が有効になっているかを確認する
$ vim --version | grep ruby
+printer -profile -python +quickfix +reltime -rightleft -ruby +scrollbind
vim をアンインストール
$ sudo port clean vim
Password:
---> Cleaning vim
MacPorts で vim をインストール
$ sudo port install vim +multibyte +ruby
---> Fetching ctags
---> Attempting to fetch ctags-5.7.tar.gz from http://nchc.dl.sourceforge.net/ctags
---> Verifying checksum(s) for ctags
---> Attempting to fetch ncurses-5.7.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/ncurses
---> Attempting to fetch gettext-0.17.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/gettext
---> Attempting to fetch perl-5.8.8.tar.bz2 from http://distfiles.macports.org/perl5.8
---> Attempting to fetch gettext-1.05.tar.gz from ftp://ftp.cpan.org/pub/CPAN/modules/by-module/Locale
---> Attempting to fetch help2man-1.36.4.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/help2man
---> Attempting to fetch m4-1.4.12.tar.bz2 from ftp://ftp.dti.ad.jp/pub/GNU/m4
---> Attempting to fetch autoconf-2.63.tar.bz2 from ftp://ftp.dti.ad.jp/pub/GNU/autoconf
---> Attempting to fetch openssl-0.9.8i.tar.gz from http://distfiles.macports.org/openssl
---> Attempting to fetch readline52-001 from ftp://ftp.dti.ad.jp/pub/GNU/readline/readline-5.2-patches/
---> Attempting to fetch readline-5.2.tar.gz from http://distfiles.macports.org/readline
---> Attempting to fetch ruby-1.8.7-p72.tar.bz2 from ftp://ftp.iij.ad.jp/pub/lang/ruby/1.8
---> Attempting to fetch vim-7.2.tar.bz2 from http://distfiles.macports.org/vim72
---> Attempting to fetch vim-7.2-extra.tar.gz from http://distfiles.macports.org/vim72
---> Attempting to fetch vim-7.2-lang.tar.gz from http://distfiles.macports.org/vim72
---> Installing vim @7.2.065_0+ruby
---> Activating vim @7.2.065_0+ruby
---> Cleaning vim
vim-ruby をインストール
$ sudo gem install vim-ruby
$ sudo vim-ruby-install.rb
Possible Vim installation directories:
1) /Users/foo/.vim
2) /usr/share/vim/vimfiles
Please select one (or anything else to specify another directory): 1
Target directory '/Users/foo/.vim' does not exist.
Do you want to create it? [Yn] y
ホームディレクトリの .vimrc を編集
$ vi ~/.vimrc
set tabstop=2
set shiftwidth=2
set expandtab
set autoindent
set nocompatible
syntax on
filetype on
filetype indent on
filetype plugin on
vim で ruby が有効になっているかを確認
$ vim --version | grep ruby
+printer -profile -python +quickfix +reltime -rightleft -ruby +scrollbind