Loading ...
Sorry, an error occurred while loading the content.

New to Vim, Japanese setup

Expand Messages
  • Rick Frankum
    Hello, I m trying to figure out how to configure vim on my system. I m running Windows XP (English menus, but with Japanese support enabled) and would like to
    Message 1 of 4 , Oct 4, 2003
    • 0 Attachment
      Hello,

      I'm trying to figure out how to configure vim on my system.
      I'm running Windows XP (English menus, but with Japanese
      support enabled) and would like to edit Japanese
      files (S-JIS enc), but the documentation is slightly
      confusing. I'd appreciate any help that the list can offer.

      1) I downloaded the self-extracting binary from vim.org. The
      documentation says to use :version to check if the multi-byte
      setting is enabled, but +multi_byte_ime/dyn is reported. Is this
      the same setting?

      2) If not, how can I build a multibyte enabled vim on my
      machine? The "do-it-yourself" files at vim.org seem to be
      Unix-centric.

      3) If I open the S-JIS file in vim, I get raw garbage. No
      amount of setting the termencoding or encoding will result in
      readable characters. Is there a way to fix this?

      My current workaround is to load the file in Netscape just
      so I can read it, but I'd love to have a Japanese-aware
      editor.

      Thanks for any help,
      --Rick Frankum
    • Tony Mechelynck
      ... Hello. I have only some of the answers you are looking for. Probably someone else will jump in to fill in what I didn t know. ... +multi_byte_ime/dyn means
      Message 2 of 4 , Oct 4, 2003
      • 0 Attachment
        Rick Frankum <frankum@...> wrote:
        > Hello,

        Hello.

        I have only some of the answers you are looking for. Probably someone else
        will jump in to fill in what I didn't know.
        >
        > I'm trying to figure out how to configure vim on my system.
        > I'm running Windows XP (English menus, but with Japanese
        > support enabled) and would like to edit Japanese
        > files (S-JIS enc), but the documentation is slightly
        > confusing. I'd appreciate any help that the list can offer.
        >
        > 1) I downloaded the self-extracting binary from vim.org. The
        > documentation says to use :version to check if the multi-byte
        > setting is enabled, but +multi_byte_ime/dyn is reported. Is this
        > the same setting?

        +multi_byte_ime/dyn means that your version of Vim can use an "input method"
        to input multi-byte characters (for example, kanji) on W32 provided that
        some external library (some .dll file, on Windows) is present at run-time.
        As I understand it, such a capability can only be present if "ordinary"
        multi-byte handling is (at least dynamically) included. But you can check
        it: To check for one particular capability such has +multi_byte, do

        :echo has("multi_byte")

        If the answer is non-zero (1, usually) the feature is present. If the answer
        is 0 the feature is absent.

        Note:The gvim version I am using also mentions +multi_byte_ime/dyn (and
        neither +multi_byte nor -multi_byte) in the :version report. I know that it
        has multi-byte support because the :echo statement above reports 1, and I
        use this gvim version for Cyrillic editing in utf-8, which requires the
        +multi_byte capability but not necessarily IME support.
        >
        > 2) If not, how can I build a multibyte enabled vim on my
        > machine? The "do-it-yourself" files at vim.org seem to be
        > Unix-centric.

        I don't know, I only use precompiled versions of gvim. But I think that
        yours has the required capability.
        >
        > 3) If I open the S-JIS file in vim, I get raw garbage. No
        > amount of setting the termencoding or encoding will result in
        > readable characters. Is there a way to fix this?

        try doing

        :if &termencoding == "" | let &termencoding = &encoding | endif
        :set encoding=sjis
        :edit ++enc=sjis filename

        If it works, try

        :set fileencodings?

        to see if vim is set to recognise sjis when opening an existing file for
        editing
        >
        > My current workaround is to load the file in Netscape just
        > so I can read it, but I'd love to have a Japanese-aware
        > editor.
        >
        > Thanks for any help,
        > --Rick Frankum

        My pleasure.

        Summary of where to look for help on the above:

        :help +multi_byte
        :help +multi_byte_ime
        :help has()
        :help 'termencoding'
        :help 'encoding'
        :help 'fileencoding'
        :help 'fileencodings'
        :help ++opt

        and follow the links from there.

        HTH,
        Tony.
      • Rick Frankum
        ... I appreciate it! ... To update: the vim I have is indeed multibyte-enabled. The big problem appears to be that I m not editing S-JIS files but in fact
        Message 3 of 4 , Oct 5, 2003
        • 0 Attachment
          Tony Mechelynck wrote:
          > I have only some of the answers you are looking for. Probably someone else
          > will jump in to fill in what I didn't know.

          I appreciate it!
          >>I'm trying to figure out how to configure vim on my system.
          >>I'm running Windows XP (English menus, but with Japanese
          >>support enabled) and would like to edit Japanese
          >>files (S-JIS enc), but the documentation is slightly
          >>confusing. I'd appreciate any help that the list can offer.

          To update: the vim I have is indeed multibyte-enabled. The big
          problem appears to be that I'm not editing S-JIS files but
          in fact EUC-jp. When I run vim under Windows it doesn't
          recognize (I tried :set encoding=euc-jp) the encoding,
          and when I run it under Cygwin I still get garbage (though
          it _does_ recognize euc-jp but not cp932).

          Hiroji Kimura writes:
          > http://www.kaoriya.net/#VIM6
          > Try the above link. That's what I use to edit Japanese.

          If I can't get the standard version working, I'll try this. What's
          a .bz2 extension, though?

          Eric Long writes:
          > When you say you get raw garbage, does that mean you see a lot of
          > accented letters, or do you get a lot of stuff like ~B and ~K
          > (or perhaps <82> and <8b>) ? If you have the accented letters it'll
          > probably work with the right font, but if you have the ~B and ~K it
          > means the encoding isn't getting set right.

          The garbage I refer to is mostly half-width katakana and dots.

          Thanks again for the help,
          --Rick
          frankum@...
        • Glenn Maynard
          ... You need iconv.dll to handle euc-jp. You also need to change fileencoding , not encoding . encoding represents the internal representation, and should
          Message 4 of 4 , Oct 5, 2003
          • 0 Attachment
            On Mon, Oct 06, 2003 at 01:13:40AM +0900, Rick Frankum wrote:
            > To update: the vim I have is indeed multibyte-enabled. The big
            > problem appears to be that I'm not editing S-JIS files but
            > in fact EUC-jp. When I run vim under Windows it doesn't
            > recognize (I tried :set encoding=euc-jp) the encoding,
            > and when I run it under Cygwin I still get garbage (though
            > it _does_ recognize euc-jp but not cp932).

            You need iconv.dll to handle euc-jp.

            You also need to change "fileencoding", not "encoding". "encoding"
            represents the internal representation, and should be set to "utf-8".

            --
            Glenn Maynard
          Your message has been successfully submitted and would be delivered to recipients shortly.