vimのインストール
> cd /usr/pkgsrc/editers/vim
> make install
ERROR: This package has set PKG_FAIL_REASON:
ERROR: vim-7.2.446 has an unacceptable license condition:
ERROR: vim-license
ERROR: You can mark the license ``vim-license'' as acceptable by adding
ERROR: ACCEPTABLE_LICENSES+= vim-license
ERROR: to /etc/mk.conf or by adding
ERROR: ACCEPTABLE_LICENSES= vim-license
ERROR: to /etc/pkg_install.conf.
ERROR: The following command will show you the license text:
ERROR: /usr/bin/make show-license
*** Error code 1
ライセンスの確認です。/etc/mk.confを編集したあとインストールを再開します。
ACCEPTABLE_LICENSES+= vim-license
viでvim起動
viと打ってvimが起動するようにします。viewも一緒に変えます。~/.bash_profile または ~/.profileを編集します。
alias vi='vim'
alias view='vim -R'
個人的な設定
お好みでどうぞ。~/.vimrcを編集します。
set tabstop=2
set shiftwidth=2
"set expandtab
set ruler
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8,ucs-bom,euc-jp,cp932,iso-2022-jp
ファイルタイププラグイン
ファイルタイプ別に色を変えたり支援をしてくれる設定をします。~/.vimフォルダ内を編集します。
# mkdir ~/.vim
# ln -s /usr/pkg/share/vim/vim72/ftplugin ~/.vim/ftplugin
2014.8.10
上記は間違いです。:set runtimepathに/usr/pkg/share/vim/vim72が含まれているので不要でした。
続いて~.vimrcを編集します。
filetype plugin indent on
syntax enable
標準のftpluginの設定を変更したい場合は以下のようにします。rubyの場合です。
~.vim/after/ftplugin/ruby.vim を作って編集します。これでタブは空白文字2文字になります。
set shiftwidth=2
set tabstop=2
set expandtab