昨日はDebian上でのvim-rubyインストールについて書いたが、今回はcygwin上。手元のマシンがWindowsなので、Windows上でも同じように使えたら便利だと思い挑戦。
rubyのライブラリの管理コマンド"gem"のインストールはこちらに書いているので省略。その他ruby関連のパッケージはあらかじめ入れておかないと失敗するかもしれないです。
# gem install vim-ruby # vim-ruby-install.rb ← /bin にあるので、そのまま実行できます。
デフォルトのvimはrubyインタフェースを実装していないので、対応版をインストールしたいところですが、Debianのように用意されていないので、自分でコンパイルする必要がありそうです。
# wget ftp://ftp.vim.org/pub/vim/unix/vim-7.2.tar.bz2 ← ソースのダウンロード # tar xvfj vim-7.2.tar.bz2 # cd vim72
vimのconfigureをする時のオプションを指定。GUIを使わないようにしておかないと、vimの起動がめちゃくちゃ遅くなります。ruby有効は--enable-rubyinterpを指定。
# ./configure --enable-rubyinterp --without-x --disable-gui --with-features=big
成功したらコンパイル
# make # make install
インストール済みのvimを待避し、新しいvimを使うようにシンボリックリンクをはる。
# cd /usr/bin # mv vim.exe vim.org.exe # ln -s /usr/local/bin/vim.exe vim.exe
rubyインタフェースが有効になっているかどうかは以下のように +ruby になっていればOK。
# vim --version VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Aug 24 2008 11:00:00) Compiled by mazn@localhost Big version without GUI. Features included (+) or not (-): +arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse -mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra -perl +postscript +printer -profile -python +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" user exrc file: "$HOME/.exrc" fall-back for $VIM: "/usr/local/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -I/usr/lib/ruby/1.8/i386-cygwin Linking: gcc -L. -L/usr/local/lib -o vim.exe -lm -lncurses -liconv -lruby