Mr Kirkland

setting up terminal and vim for japanese on osx

Bookmark and Share

I’d hazzard a guess that there aren’t a great deal of non-japanese vi users on osx who need to work in japanese, but at the very least this will serve as a reminder for myself later on!

First up, the most useful resource I found was the following page http://osksn2.hep.sci.osaka-u.ac.jp/~taku/osx/vimjp.html (thanks to Taku Yamanaka!)

If you can read Japanese, then follow his instructions otherwise, the key steps are:

Setting up VIM

edit. you ~/.vimrc file and add:

:set enc=utf-8
:set fenc=utf-8
:set fencs=iso-2022-jp,euc-jp,cp932

Edit your terminal settings

  • File -> Show Info (ファイル>情報を見る)
  • Go to Emulation (エミュレーション)
  • uncheck Escape non-Ascii characters (非Ascii文字をエスケープする)
  • Go To Display (ディスプレイ)
  • Check Wide glyphs count as 2 columns (ワイドグリフは2桁とカウントする) and Wide glyphs for Japanes/Chinese/etc.(日本語や中国語などにワイドグリフを使用する)
  • You’ll probably want to make the settings default (設定をデフォルトとして使用)

Bash

For good measure you might want to tweak bash. Edit ~/.profile and add:

export LC_CTYPE=en_US.UTF-8

Edit ~/.inputrc and add:

set input-meta on
set output-meta on
set convert-meta off
set meta-flag on
set output-meta on

You’ll need to reload bash for these changes to take affect - close and reopen terminal.

Leave a Reply




Timezone

  • JST: 2008-07-06 05:47
  • BST: 2008-07-05 21:47
  • PDT: 2008-07-05 13:47