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

Re: How to edit .reg files

Expand Messages
  • Bruce Who
    Hi, Mechelynck: I installed the patch, and add below code to my _vimrc file: set termencoding=cp936 set encoding=UTF-8 set fileencodings=ucs-bom,utf-8,cp936
    Message 1 of 55 , Apr 29, 2005
    • 0 Attachment
      Hi, Mechelynck:

      I installed the patch, and add below code to my _vimrc file:

      set termencoding=cp936
      set encoding=UTF-8
      set fileencodings=ucs-bom,utf-8,cp936
      setg bomb
      set guifont=NSimsun:h12:cDEFAULT

      and the symdrone now is still the same as what I depict in my last post.

      ======= 2005-04-29 17:00:20 A. J. Mechelynck wrote: =======

      >Bruce Who wrote:
      >> Strohhaecker, Bernd:
      >>
      >>
      >>
      >> ======= 2005-04-29 16:31:25 Strohhaecker, Bernd wrote: =======
      >>
      >>
      >>>Bruce Who wrote:
      >>>
      >>>
      >>>> thanks for the explanation, but how to view this kind of files?
      >>>>
      >>>
      >>>For me "gvim xx.reg" works fine. Dito with "gvim -u NONE -U NONE
      >>>--noplugin xx.reg".
      >>
      >>
      >> I tried both, and it still behaved like before.
      >>
      >>
      >>>Same with vim (MS-Windows 32 Bit Konsolen Version) and also with vi
      >>>under cygwin & zsh.
      >>>
      >>>Did you look at Tony's link ?
      >>>
      >>>BTW, which vim-version and is multi-byte enabled at all ?
      >>
      >>
      >> It's gVim63 and multi-byte enabled. I downloaded the self-installing .exe file and installed gvim.
      >>
      >>
      >>>Try :ver or :echo has("multi_byte")
      >>>
      >>>Regards, Bernd
      >>>.
      >>
      >>
      >> = = = = = = = = = = = = = = = = = = = =
      >>
      >>
      >>         Bruce Who
      >>           2005-04-29
      >>
      >>
      >>
      >>
      >When you type
      >
      > :version
      >
      >do you see near the top a line beginning with "Included patches:"? If
      >you don't, it means you have gvim 6.3.000. In that case, try installing
      >gvim 6.3.071 from my site
      >http://users.skynet.be/antoine.mechelynck/vim/#ajm and see if anything
      >changes.
      >
      >
      >Best regards,
      >Tony.
      >
      >.

      = = = = = = = = = = = = = = = = = = = =


              Bruce Who
                2005-04-30
    • A. J. Mechelynck
      ... [...] ... With a BOM at the start of the file (like here), ucs-bom will set bomb on, and whichever Unicode encoding is indicated by the BOM. Without a
      Message 55 of 55 , May 8 5:26 AM
      • 0 Attachment
        Bruce Who wrote:
        > Tony:
        >
        > ======= 2005-05-08 12:03:47 A. J. Mechelynck wrote: =======
        >
        >
        [...]
        >>After Vim displays a .reg file correctly, what is the answer to:
        >>
        >> :set enc? fencs? fenc? bomb?
        >>
        >>(with the question marks, and with the file in question being the
        >>current file)?
        >
        >
        > it's
        >
        > encoding=utf-8
        > fileencodings=ucs-bom,utf-8,latin1
        > fileencoding=ucs-2le
        > bomb
        >
        > ucs-2le is not in the fileencodings list, but the fileencoding is ucs-2le
        > here. It doesn't seem consistent with what document says.
        >
        >

        With a BOM at the start of the file (like here), "ucs-bom" will set
        'bomb' on, and whichever Unicode encoding is indicated by the BOM.
        Without a BOM, 'bomb' will be set off, and one of the other subfields of
        'fileencodings' will have to detect the exact encoding.

        See
        the last paragraph of ":help 'bomb'"
        ":help 'fileencodings'" then search
        /For an empty file
        /The special value
        ":help 45.4" then search
        /^\tucs-bom
        /If the default
        ":help version6.txt" then :646

        >>With proper settings, enc=utf-8 should be usable, even to edit cp936
        >>files under WinXP; but you might prefer use different Vim jobs
        >
        >
        > yeah, enc=utf-8 is usable except it cause things like <b3><b2> on the titlebar,
        > and make it impossible to open a file whose path contains chinese characters(such
        > as F:\中文\dir\file.txt ) by right-clicking.

        That might be a symptom of a bug, but I'm not sure about that. I'm
        copying Bram on this thread, just in case.

        >
        > The best choice maybe is to view .reg files with notepad, and leave the rest to vim, ^_^ .
        >
        > And thanks for your always kind helps.
        >
        > I attach a .reg file in my post.

        Yes, that's a UCS-2le file with a BOM. I have no problems opening it
        with gvim 7.0aa, using drag-drop and the following settings. These are
        the values of a few options after opening the file (extracted by
        redirecting the ":set" listing to the clipboard and editing away many
        irrelevant options):

        bomb
        encoding=utf-8
        fileencoding=ucs-2le
        fileencodings=ucs-bom,utf-8,default,latin1
        fileformats=dos,unix,mac
        guifont=MingLiU:h14:cDEFAULT
        termencoding=latin1

        In that instance of gvim, I also have
        :lang
        Current language: "French_Belgium.1252"
        :lang mess
        Current messages language: "en"

        YMMV (Your Mileage May Vary).

        >
        >
        >>(possibly
        >>started with different .bat files and/or with different
        >>"project-specific" vimrc's via the -u command-line argument) for reg
        >>files on the one hand and for Chinese files on the other hand.
        >>
        >>Here is an example (modify as needed):
        >>
        >>--- zhvim.bat
        >>@echo off
        >>c:
        >>cd %HOME%\Chinese
        >>gvim.exe -u .\_vimrc %1 %2 %3 %4 %5 %6 %7 %8 %9
        >>
        >>--- Chinese\_vimrc
        >>set nocompatible
        >>source ~/_vimrc
        >>" Chinese specific settings come here
        >>
        >>--- regvim.bat
        >>@echo off
        >>c:
        >>cd %HOME%\regfiles
        >>gvim.exe -u .\_vimrc %1 %2 %3 %4 %5 %6 %7 %8 %9
        >>
        >>--- regfiles\_vimrc
        >>set nocompatible
        >>source ~/_vimrc
        >>" settings specific to .reg files comes here
        >>
        >>
        >>Best regards,
        >>Tony.
        >>
        >>.
        >
        >
        > = = = = = = = = = = = = = = = = = = = =
        >
        > Best regards,
        >
        >         Bruce Who
        >           2005-05-08

        Best regards,
        Tony 馬頭逆 马头逆 :-)
        http://users.skynet.be/antoine.mechelynck/
      Your message has been successfully submitted and would be delivered to recipients shortly.