Vim installation on Windows - without registry entries?

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

Vim installation on Windows - without registry entries?

Bouckaert, Hugo
Hi
 
Just a general question about installing gvim on Windows. I was
wondering if it is possible to install gvim without touching the
registry. The reason I am asking is that I am often moving from machine
to machine without always having administrative permissions i.e. I
cannot always install a new version of vim if it alters the registry. I
saw that in the registry, under HKEY_LOCAL_MACHINE\SOFTWARE there is a
vim entry but it is minimal - just a path entry with the path to the
exe.
 
So a great solution would be to set up vim exactly as I like it in my
home directory, available to me from any machine I log into. So rather
than having gvim installed in C:\Program Files\Vim\vim63 as is the case
now, I would put install it, as an ordinary user, on U:\vim\vim6.3 (or
7.0), without altering the registry of any local machine during the
installation.
 
Is this possible and would it give me a fully functional gvim? Also,
would this vim installation be "transportable"  in the sense that it can
be zipped/unzipped to any other drive, then still work once unzipped in
the new location?  
 
Thanks
 
Hugo  
 
Hugo Bouckaert
Oracle Analyst / Programmer
Two's Complement Computing
--------------------------------------------------
This email and any attachments may be confidential or legally
privileged. If you received this message in error or are not the
intended recipient, you should destroy the e-mail message and any
attachments or copies, and you are prohibited from retaining,
distributing, disclosing or using any information contained herein.
Please inform us of the erroneous delivery by return e-mail. Thank you
for your cooperation.
 
 
Reply | Threaded
Open this post in threaded view
|

inputting unicode text problem

Vu The Cuong
Hi all,
I'm using WinXP English version and Japan version.
Inputting unicode japanese text into vim have no problem.
But when I input unicode vietnamese text into vim, the vietnamese characters
became can not readable.
Could anyone give me a advice on it?
many thanks

Reply | Threaded
Open this post in threaded view
|

strange problem in register

Vu The Cuong
In reply to this post by Bouckaert, Hugo
Hi all
For example: I already registered d with database.
I can type @d for "database" to appear in the file. It worked well.

Then I copied other text in Vim or in other application (ex: MS word) with
ctl-v.
(Assumed the copied text is: "abcdef")
Now I typed @d again. But the word appeared is not "database", it is
"abcdef".

Could anyone tell me how can avoid this problem?
many thanks

Reply | Threaded
Open this post in threaded view
|

Re: inputting unicode text problem

Matthew Huggett
In reply to this post by Vu The Cuong
Hi,

Assuming you have a Vietnamese font, make sure that you've got the
encoding right in vim.  I usually have my files in utf-8 encoding, so I
usually put

,-------------------------
| vim:encoding=utf-8:
`-------------------------

at the top of my files.  Alternatively, you could do

,-------------------------
| :set encoding=utf-8
`-------------------------

(Just change the utf-8 part to whatever you need.  If you're on a
Japanese version of Windows and you can get kanji etc in vim, then your
encoding is probably defaulting to SJIS)

Do

,-------------------------
| :h encoding
`-------------------------

and

,-------------------------
| :h filencodings
`-------------------------

for more info.

regards,

Matt

Vu The Cuong wrote:

> Hi all,
> I'm using WinXP English version and Japan version.
> Inputting unicode japanese text into vim have no problem.
> But when I input unicode vietnamese text into vim, the vietnamese characters
> became can not readable.
> Could anyone give me a advice on it?
> many thanks
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: inputting unicode text problem

Matthew Huggett
Ooops. Typo.  That should be

,-------------------------
| :h fileencodings
`-------------------------

Matt

Matthew Huggett wrote:
 > Hi,
 >
 > Assuming you have a Vietnamese font, make sure that you've got the
 > encoding right in vim.  I usually have my files in utf-8 encoding, so I
 > usually put
 >
 > ,-------------------------
 > | vim:encoding=utf-8:
 > `-------------------------
 >
 > at the top of my files.  Alternatively, you could do
 >
 > ,-------------------------
 > | :set encoding=utf-8
 > `-------------------------
 >
 > (Just change the utf-8 part to whatever you need.  If you're on a
 > Japanese version of Windows and you can get kanji etc in vim, then your
 > encoding is probably defaulting to SJIS)
 >
 > Do
 >
 > ,-------------------------
 > | :h encoding
 > `-------------------------
 >
 > and
 >
 > ,-------------------------
 > | :h filencodings
 > `-------------------------
 >
 > for more info.
 >
 > regards,
 >
 > Matt
 >
 > Vu The Cuong wrote:
 >
 >> Hi all,
 >> I'm using WinXP English version and Japan version.
 >> Inputting unicode japanese text into vim have no problem.
 >> But when I input unicode vietnamese text into vim, the vietnamese
 >> characters
 >> became can not readable.
 >> Could anyone give me a advice on it?
 >> many thanks
 >>
 >>
 >>
 >
 >
Reply | Threaded
Open this post in threaded view
|

Re: inputting unicode text problem

Vu The Cuong
In reply to this post by Matthew Huggett
Hi Matthew Huggett
Thank you. It woked for me:)
By the way, related to input text, could you tell me how can I set default
font to times new roman or tahoma?
thank you in advanced.

----- Original Message -----
From: "Matthew Huggett" <[hidden email]>
To: "Vu The Cuong" <[hidden email]>
Cc: <[hidden email]>
Sent: Thursday, August 18, 2005 11:20 AM
Subject: Re: inputting unicode text problem


> Hi,
>
> Assuming you have a Vietnamese font, make sure that you've got the
> encoding right in vim.  I usually have my files in utf-8 encoding, so I
> usually put
>
> ,-------------------------
> | vim:encoding=utf-8:
> `-------------------------
>
> at the top of my files.  Alternatively, you could do
>
> ,-------------------------
> | :set encoding=utf-8
> `-------------------------
>
> (Just change the utf-8 part to whatever you need.  If you're on a
> Japanese version of Windows and you can get kanji etc in vim, then your
> encoding is probably defaulting to SJIS)
>
> Do
>
> ,-------------------------
> | :h encoding
> `-------------------------
>
> and
>
> ,-------------------------
> | :h filencodings
> `-------------------------
>
> for more info.
>
> regards,
>
> Matt
>
> Vu The Cuong wrote:
> > Hi all,
> > I'm using WinXP English version and Japan version.
> > Inputting unicode japanese text into vim have no problem.
> > But when I input unicode vietnamese text into vim, the vietnamese
characters
> > became can not readable.
> > Could anyone give me a advice on it?
> > many thanks
> >
> >
> >

Reply | Threaded
Open this post in threaded view
|

Re: inputting unicode text problem

Matthew Huggett
Have a look at

,-------------------------
|:h mbyte-fonts-MSwin
`-------------------------

Matt

Vu The Cuong wrote:
 > Hi Matthew Huggett
 > Thank you. It woked for me:)
 > By the way, related to input text, could you tell me how can I set
default
 > font to times new roman or tahoma?
 > thank you in advanced.
 >
 > ----- Original Message -----
 > From: "Matthew Huggett" <[hidden email]>
 > To: "Vu The Cuong" <[hidden email]>
 > Cc: <[hidden email]>
 > Sent: Thursday, August 18, 2005 11:20 AM
 > Subject: Re: inputting unicode text problem
 >
 >
 >
 >>Hi,
 >>
 >>Assuming you have a Vietnamese font, make sure that you've got the
 >>encoding right in vim.  I usually have my files in utf-8 encoding, so I
 >>usually put
 >>
 >>,-------------------------
 >>| vim:encoding=utf-8:
 >>`-------------------------
 >>
 >>at the top of my files.  Alternatively, you could do
 >>
 >>,-------------------------
 >>| :set encoding=utf-8
 >>`-------------------------
 >>
 >>(Just change the utf-8 part to whatever you need.  If you're on a
 >>Japanese version of Windows and you can get kanji etc in vim, then your
 >>encoding is probably defaulting to SJIS)
 >>
 >>Do
 >>
 >>,-------------------------
 >>| :h encoding
 >>`-------------------------
 >>
 >>and
 >>
 >>,-------------------------
 >>| :h filencodings
 >>`-------------------------
 >>
 >>for more info.
 >>
 >>regards,
 >>
 >>Matt
 >>
 >>Vu The Cuong wrote:
 >>
 >>>Hi all,
 >>>I'm using WinXP English version and Japan version.
 >>>Inputting unicode japanese text into vim have no problem.
 >>>But when I input unicode vietnamese text into vim, the vietnamese
 >
 > characters
 >
 >>>became can not readable.
 >>>Could anyone give me a advice on it?
 >>>many thanks
 >>>
 >>>
 >>>
 >
 >
 >
 >
Reply | Threaded
Open this post in threaded view
|

Re: Vim installation on Windows - without registry entries?

A.J.Mechelynck
In reply to this post by Bouckaert, Hugo
----- Original Message -----
From: "Bouckaert, Hugo" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, August 18, 2005 3:18 AM
Subject: Vim installation on Windows - without registry entries?


> Hi
>
> Just a general question about installing gvim on Windows. I was
> wondering if it is possible to install gvim without touching the
> registry. The reason I am asking is that I am often moving from machine
> to machine without always having administrative permissions i.e. I
> cannot always install a new version of vim if it alters the registry. I
> saw that in the registry, under HKEY_LOCAL_MACHINE\SOFTWARE there is a
> vim entry but it is minimal - just a path entry with the path to the
> exe.
>
> So a great solution would be to set up vim exactly as I like it in my
> home directory, available to me from any machine I log into. So rather
> than having gvim installed in C:\Program Files\Vim\vim63 as is the case
> now, I would put install it, as an ordinary user, on U:\vim\vim6.3 (or
> 7.0), without altering the registry of any local machine during the
> installation.
>
> Is this possible and would it give me a fully functional gvim? Also,
> would this vim installation be "transportable"  in the sense that it can
> be zipped/unzipped to any other drive, then still work once unzipped in
> the new location?
>
> Thanks
>
> Hugo
>
> Hugo Bouckaert
> Oracle Analyst / Programmer
> Two's Complement Computing

Gvim with OLE (required for Visual Studio integration) will ask you to
register whenever it finds at startup that it isn't; and the OLE
functionality won't be usable without that registering. If you compile for
yourself a gvim without OLE, or if you use console Vim, they will work (to
the full of their respective powers) with no need for a registry entry. The
functionalities which _cannot_ be used without a registry entry are (IIUC):

    - OLE, including VisVim
    - "edit with Vim" in the Explorer right-click menu.

With these exceptions, it is possible (IIUC) to use all the vim and gvim
functionalities without touching the registry; but to avoid annoying prompts
at gvim startup if you don't even want to let _it_ modify the registry at
its first startup on a new machine, you might want to make a gvim without
OLE; alternately, use gvim with OLE and invoke it immediately after
installing on a new machine so it will register itself once and for all. The
latter may require administrator privileges though.

See http://users.skynet.be/antoine.mechelynck/vim/compile.htm for more info
(and links to still more info) about how to compile your own Vim on Windows.
It's not really hard once you get the hang of it.

Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: inputting unicode text problem

A.J.Mechelynck
In reply to this post by Vu The Cuong
----- Original Message -----
From: "Vu The Cuong" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, August 18, 2005 3:28 AM
Subject: inputting unicode text problem


> Hi all,
> I'm using WinXP English version and Japan version.
> Inputting unicode japanese text into vim have no problem.
> But when I input unicode vietnamese text into vim, the vietnamese
> characters
> became can not readable.
> Could anyone give me a advice on it?
> many thanks

I suspect that your Japanese 'guifont' hasn't got the glyphs (the character
shapes) for Vietnamese (BTW, you are using gvim, not console Vim aren't
you?). See my tip "Setting the font in the GUI"
http://vim.sourceforge.net/tips/tip.php?tip_id=632

In short: I don't believe that you'll find a font with _both_ Japanese and
Vietnamese (just like _I_ didn't find a font with both Chinese and Arabic)
so you'll have to change fonts "on the fly" whenever you change from one of
these languages to the other.

You might try

    :set guifont=MS_Gothic:h12:cDEFAULT

(or something similar) for Japanese, and

    :set guifont=Courier_New:h10:cDEFAULT

(or something similar) for Vietnamese; if it doesn't show the proper glyphs,
you might try

    :set guifont=*

to hunt for them in a menu; OTOH if the shapes are correct but you want to
make them bigger or smaller, use (assuming 'nocompatible' is set)

    :set guifont=<Tab>

to edit the current setting on the command-line (the h part is what
determines character size) then hit Enter to accept the changes or Esc to
reject them.

About the last sub-parameter (cDEFAULT), it is (in my experience) better to
leave it at DEFAULT; in that case gvim will choose between the various
"national" variant fonts of the same name, the one which has the glyph you
need for each particular character.

If you have _no_ Vietnamese fonts _at all_ installed on your machine, you
will have to get them (maybe as part of a Language Pack); your Windows CD
(if you have one) is the first place to check.

When you change the 'guifont', your Vim window may resize itself to reflect
the changed size of the characters; you may want to change 'lines' and
'columns' at the same time; for instance

    :set guifont=Courier_New:h9:cDEFAULT lines=99999 columns=99999

(all on one line) will both set the 'guifont' to 9pt "Courier New" and keep
gvim maximized (or nearly so).


Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: strange problem in register

A.J.Mechelynck
In reply to this post by Vu The Cuong
----- Original Message -----
From: "Vu The Cuong" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, August 18, 2005 3:50 AM
Subject: strange problem in register


> Hi all
> For example: I already registered d with database.
> I can type @d for "database" to appear in the file. It worked well.
>
> Then I copied other text in Vim or in other application (ex: MS word) with
> ctl-v.
> (Assumed the copied text is: "abcdef")
> Now I typed @d again. But the word appeared is not "database", it is
> "abcdef".
>
> Could anyone tell me how can avoid this problem?
> many thanks

Avoid clobbering a register which is already used for something. If you use
"d in front of a yank or delete command, the data yanked or deleted will be
put into register d. If you already had something there, it's gone.

There are 26 lettered registers in Vim; that should be enough for most
applications. (Normally the Paste menu or the mswin.vim ^V command use none
of them but only the "+ or "* clipboard "register".)

Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: inputting unicode text problem

Matthew Huggett
In reply to this post by A.J.Mechelynck
 > In short: I don't believe that you'll find a font with _both_ Japanese
 > and Vietnamese (just like _I_ didn't find a font with both Chinese and
 > Arabic) so you'll have to change fonts "on the fly" whenever you change
 > from one of these languages to the other.

Unless you use a font like Arial Unicode MS or Code2000 that covers a
wide swath of unicode.


Matt



Tony Mechelynck wrote:
 > ----- Original Message ----- From: "Vu The Cuong"
 > <[hidden email]>
 > To: <[hidden email]>
 > Sent: Thursday, August 18, 2005 3:28 AM
 > Subject: inputting unicode text problem
 >
 >
 >> Hi all,
 >> I'm using WinXP English version and Japan version.
 >> Inputting unicode japanese text into vim have no problem.
 >> But when I input unicode vietnamese text into vim, the vietnamese
 >> characters
 >> became can not readable.
 >> Could anyone give me a advice on it?
 >> many thanks
 >
 >
 > I suspect that your Japanese 'guifont' hasn't got the glyphs (the
 > character shapes) for Vietnamese (BTW, you are using gvim, not console
 > Vim aren't you?). See my tip "Setting the font in the GUI"
 > http://vim.sourceforge.net/tips/tip.php?tip_id=632
 >
 > In short: I don't believe that you'll find a font with _both_ Japanese
 > and Vietnamese (just like _I_ didn't find a font with both Chinese and
 > Arabic) so you'll have to change fonts "on the fly" whenever you change
 > from one of these languages to the other.
 >
 > You might try
 >
 >    :set guifont=MS_Gothic:h12:cDEFAULT
 >
 > (or something similar) for Japanese, and
 >
 >    :set guifont=Courier_New:h10:cDEFAULT
 >
 > (or something similar) for Vietnamese; if it doesn't show the proper
 > glyphs, you might try
 >
 >    :set guifont=*
 >
 > to hunt for them in a menu; OTOH if the shapes are correct but you want
 > to make them bigger or smaller, use (assuming 'nocompatible' is set)
 >
 >    :set guifont=<Tab>
 >
 > to edit the current setting on the command-line (the h part is what
 > determines character size) then hit Enter to accept the changes or Esc
 > to reject them.
 >
 > About the last sub-parameter (cDEFAULT), it is (in my experience) better
 > to leave it at DEFAULT; in that case gvim will choose between the
 > various "national" variant fonts of the same name, the one which has the
 > glyph you need for each particular character.
 >
 > If you have _no_ Vietnamese fonts _at all_ installed on your machine,
 > you will have to get them (maybe as part of a Language Pack); your
 > Windows CD (if you have one) is the first place to check.
 >
 > When you change the 'guifont', your Vim window may resize itself to
 > reflect the changed size of the characters; you may want to change
 > 'lines' and 'columns' at the same time; for instance
 >
 >    :set guifont=Courier_New:h9:cDEFAULT lines=99999 columns=99999
 >
 > (all on one line) will both set the 'guifont' to 9pt "Courier New" and
 > keep gvim maximized (or nearly so).
 >
 >
 > Best regards,
 > Tony.
 >
 >
 >
Reply | Threaded
Open this post in threaded view
|

Re: inputting unicode text problem

A.J.Mechelynck
----- Original Message -----
From: "Matthew Huggett" <[hidden email]>
To: "Tony Mechelynck" <[hidden email]>
Cc: "Vu The Cuong" <[hidden email]>; <[hidden email]>
Sent: Thursday, August 18, 2005 12:28 PM
Subject: Re: inputting unicode text problem


> > In short: I don't believe that you'll find a font with _both_ Japanese
> > and Vietnamese (just like _I_ didn't find a font with both Chinese and
> > Arabic) so you'll have to change fonts "on the fly" whenever you change
> > from one of these languages to the other.
>
> Unless you use a font like Arial Unicode MS or Code2000 that covers a
> wide swath of unicode.
>
>
> Matt

The "only" problem with these is that they are proportional fonts, not
fixed-width fonts, so gvim cannot use them at all (except maybe when
compiled for GTK+2, but we're talking about Windows).

Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

RE: Vim installation on Windows - without registry entries?

Keith W. Roberts
In reply to this post by A.J.Mechelynck
 

> -----Original Message-----
> From: Tony Mechelynck [mailto:[hidden email]]
> Sent: Thursday, August 18, 2005 2:12 AM
> To: Bouckaert, Hugo; [hidden email]
> Subject: Re: Vim installation on Windows - without registry entries?
>
> ----- Original Message -----
> From: "Bouckaert, Hugo" <[hidden email]>
> To: <[hidden email]>
> Sent: Thursday, August 18, 2005 3:18 AM
> Subject: Vim installation on Windows - without registry entries?
>
>
> > Hi
> >
> > Just a general question about installing gvim on Windows. I was
> > wondering if it is possible to install gvim without touching the
> > registry. The reason I am asking is that I am often moving
> from machine
> > to machine without always having administrative permissions i.e. I
> > cannot always install a new version of vim if it alters the
> registry. I
> > saw that in the registry, under HKEY_LOCAL_MACHINE\SOFTWARE
> there is a
> > vim entry but it is minimal - just a path entry with the path to the
> > exe.
> >[snip]
>
> Gvim with OLE (required for Visual Studio integration) will
> ask you to
> register whenever it finds at startup that it isn't; and the OLE
> functionality won't be usable without that registering. If
> you compile for
> yourself a gvim without OLE, or if you use console Vim, they
> will work (to
> the full of their respective powers) with no need for a
> registry entry. The
> functionalities which _cannot_ be used without a registry
> entry are (IIUC):
>
>     - OLE, including VisVim
>     - "edit with Vim" in the Explorer right-click menu.
>
> With these exceptions, it is possible (IIUC) to use all the
> vim and gvim
> functionalities without touching the registry; but to avoid
> annoying prompts
> at gvim startup if you don't even want to let _it_ modify the
> registry at
> its first startup on a new machine, you might want to make a
> gvim without
> OLE; alternately, use gvim with OLE and invoke it immediately after
> installing on a new machine so it will register itself once
> and for all. The
> latter may require administrator privileges though.
>
> See http://users.skynet.be/antoine.mechelynck/vim/compile.htm 
> for more info
> (and links to still more info) about how to compile your own
> Vim on Windows.
> It's not really hard once you get the hang of it.
>
> Best regards,
> Tony.

This is a problem endemic to working on machines where you don't have admin
privilieges.  I don't know if this would even work, but couldn't this entry
be put in HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE when the user
doesn't have admin privileges?  And then vim could look for it in both
places?

-Keith


Reply | Threaded
Open this post in threaded view
|

Re: strange problem in register

Vu The Cuong
In reply to this post by A.J.Mechelynck
Sorry to disturb you.

If you use
> "d in front of a yank or delete command, the data yanked or deleted will
be
> put into register d. If you already had something there, it's gone.

So what can I do to so that the data yanked or deleted not will be
 put into register d? Could you tell me a bit more detail?
many thanks

----- Original Message -----
From: "Tony Mechelynck" <[hidden email]>
To: "Vu The Cuong" <[hidden email]>; <[hidden email]>
Sent: Thursday, August 18, 2005 6:47 PM
Subject: Re: strange problem in register


> ----- Original Message -----
> From: "Vu The Cuong" <[hidden email]>
> To: <[hidden email]>
> Sent: Thursday, August 18, 2005 3:50 AM
> Subject: strange problem in register
>
>
> > Hi all
> > For example: I already registered d with database.
> > I can type @d for "database" to appear in the file. It worked well.
> >
> > Then I copied other text in Vim or in other application (ex: MS word)
with
> > ctl-v.
> > (Assumed the copied text is: "abcdef")
> > Now I typed @d again. But the word appeared is not "database", it is
> > "abcdef".
> >
> > Could anyone tell me how can avoid this problem?
> > many thanks
>
> Avoid clobbering a register which is already used for something. If you
use
> "d in front of a yank or delete command, the data yanked or deleted will
be
> put into register d. If you already had something there, it's gone.
>
> There are 26 lettered registers in Vim; that should be enough for most
> applications. (Normally the Paste menu or the mswin.vim ^V command use
none
> of them but only the "+ or "* clipboard "register".)
>
> Best regards,
> Tony.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: strange problem in register

Mark Woodward
In reply to this post by A.J.Mechelynck
Tony Mechelynck said the following on 18/08/2005 7:47 PM:

> ----- Original Message ----- From: "Vu The Cuong"
> <[hidden email]>
> To: <[hidden email]>
> Sent: Thursday, August 18, 2005 3:50 AM
> Subject: strange problem in register
>
>
>> Hi all
>> For example: I already registered d with database.
>> I can type @d for "database" to appear in the file. It worked well.
>>
>> Then I copied other text in Vim or in other application (ex: MS word)
>> with
>> ctl-v.
>> (Assumed the copied text is: "abcdef")
>> Now I typed @d again. But the word appeared is not "database", it is
>> "abcdef".
>>
>> Could anyone tell me how can avoid this problem?
>> many thanks
>
Hi,

You might want to look into abbreviations/maps if all you want to do is
little 'shortcuts' like this

--
Mark

Reply | Threaded
Open this post in threaded view
|

Re: strange problem in register

John (Eljay) Love-Jensen
In reply to this post by Vu The Cuong
> So what can I do to so that the data yanked or deleted not will be put into
register d?

If you don't put "d in front of the yank or delete command, the data yanked
or deleted will not be put into register d.

> Could you tell me a bit more detail?

:help yank


Reply | Threaded
Open this post in threaded view
|

Re: inputting unicode text problem

A.J.Mechelynck
In reply to this post by A.J.Mechelynck
----- Original Message -----
From: "Vu The Cuong" <[hidden email]>
To: "Tony Mechelynck" <[hidden email]>; "Matthew Huggett"
<[hidden email]>
Sent: Friday, August 19, 2005 5:00 AM
Subject: Re: inputting unicode text problem


> I'm very sorry to disturb you. May be you laugh on my  question, but I
> really need your help
> in detail about the following:
> Now I'm using Lucida_console for coding. Personally, it is a easy-look
> font
> and
> I want to use it all the time.
> But if I use this font, japanese character in Vim become can not
> readable. Could you give me the way to use this font and dislay correctly
> japanese character in Vim also.
>
> If can not, could you introduce me a easy-looking font for coding
> and capable of displaying japanese font also?
> thank you in advanced.

Lucida Console is indeed nice-looking, but it does not include kanji. All
fixed-width fonts "with kanji" that I've seen, for instance (for Japanese)
MS_Gothic and MS_Mincho, look ugly when displaying Latin. This is in part
due to the "square" shape of kanji, which implies that the Latin characters
in kanji fonts have a vertically elongated 1x2 shape. Sorry, I cannot help
you. If you want your text to "look nice" when displaying Latin _and_ see
what is in the file when displaying Japanese, you will have to change the
'guifont'. You might try the following mappings:

    :map    <F2>    :set gfn=Lucida_Console:h8:cDEFAULT    lines=99999
columns=99999<CR>

    :imap    <F2>    <C-O>:set gfn=Lucida_Console:h8:cDEFAULT    lines=99999
columns=99999<CR>

    :map    <S-F2>    :set gfn=MS_Mincho:h12:cDEFAULT    lines=99999
columns=99999<CR>

    :imap    <S-F2>    <C-O>:set gfn=MS_Mincho:h12:cDEFAULT    lines=99999
columns=99999<CR>

(each mapping all on one line of course; vary the details at will). That
way, in Normal or Insert mode, hit F2 to set Lucida font (for Latin
alphabet), or Shift-F2 to set Mincho font (for kanji).


Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: strange problem in register

A.J.Mechelynck
In reply to this post by Vu The Cuong
----- Original Message -----
From: "Vu The Cuong" <[hidden email]>
To: <[hidden email]>
Sent: Friday, August 19, 2005 2:38 AM
Subject: Re: strange problem in register


> Sorry to disturb you.
>
> If you use
>> "d in front of a yank or delete command, the data yanked or deleted will
> be
>> put into register d. If you already had something there, it's gone.
>
> So what can I do to so that the data yanked or deleted not will be
> put into register d? Could you tell me a bit more detail?
> many thanks

d or y by themselves, place the deleted or yanked data into the default
register, "". "_d uses the "black hole" register "_, the data disappears and
is not placed anywhere. "ad and "ay place the deleted or yanked data into
register a, known as "a in Normal-mode commands and as @a in expressions.
(Similarly with another letter instead of a.) "*d and "*y use the Windows
clipboard. Etc. See ":help registers" for more details.

When pasting from the clipboard with (for instance) "*p you are inserting
text from the Windows clipboard. That ought not to interfere with the
lettered registers. If it does, then you did something else which changed
those lettered registers. From what you said I cannot tell what.


Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: strange problem in register

Vu The Cuong
thanks
----- Original Message -----
From: "Tony Mechelynck" <[hidden email]>
To: "Vu The Cuong" <[hidden email]>; <[hidden email]>
Sent: Friday, August 19, 2005 9:25 PM
Subject: Re: strange problem in register


> ----- Original Message -----
> From: "Vu The Cuong" <[hidden email]>
> To: <[hidden email]>
> Sent: Friday, August 19, 2005 2:38 AM
> Subject: Re: strange problem in register
>
>
> > Sorry to disturb you.
> >
> > If you use
> >> "d in front of a yank or delete command, the data yanked or deleted
will
> > be
> >> put into register d. If you already had something there, it's gone.
> >
> > So what can I do to so that the data yanked or deleted not will be
> > put into register d? Could you tell me a bit more detail?
> > many thanks
>
> d or y by themselves, place the deleted or yanked data into the default
> register, "". "_d uses the "black hole" register "_, the data disappears
and

> is not placed anywhere. "ad and "ay place the deleted or yanked data into
> register a, known as "a in Normal-mode commands and as @a in expressions.
> (Similarly with another letter instead of a.) "*d and "*y use the Windows
> clipboard. Etc. See ":help registers" for more details.
>
> When pasting from the clipboard with (for instance) "*p you are inserting
> text from the Windows clipboard. That ought not to interfere with the
> lettered registers. If it does, then you did something else which changed
> those lettered registers. From what you said I cannot tell what.
>
>
> Best regards,
> Tony.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: inputting unicode text problem

adah
In reply to this post by Vu The Cuong
> If can not, could you introduce me a easy-looking font for coding
> and capable of displaying japanese font also?
> thank you in advanced.

My method is to switch fonts depending on the current language setting and
by shortcuts.  See the snippet from my _vimrc:

if has('multi_byte')
  if v:lang =~? '^\(zh\)\|\(ja\)\|\(ko\)'
    let s:east_lang=v:lang
    let s:west_lang='en'
  else
    let s:east_lang='zh_CN'
    let s:west_lang=v:lang
  endif

  function! UTF8_East()
    exec 'language messages ' . s:east_lang . '.UTF-8'
    set ambiwidth=double
    set encoding=utf-8
    if has('gui_running')
      set guifont=
    endif
  endfunction

  function! UTF8_West()
    exec 'language messages ' . s:west_lang . '.UTF-8'
    set ambiwidth=single
    set encoding=utf-8
    if has('gui_running')
      set guifont=Courier_New:h10:cDEFAULT
    endif
  endfunction

  function! UTF8_SwitchMode()
    if &ambiwidth == 'single'
      call UTF8_East()
    else
      call UTF8_West()
    endif
  endfunction

  if has('gui_running') && &encoding == 'utf-8'
    if v:lang =~? '^\(zh\)\|\(ja\)\|\(ko\)'
      call UTF8_East()
    else
      call UTF8_West()
    endif
  endif

  nmap <F8> :call UTF8_SwitchMode()<CR>
  imap <F8> <C-O>:call UTF8_SwitchMode()<CR>
endif

In my case, I am using the default GUI font (Fixedsys I think) if I start
GVim normally in my Chinese Windows (and ambiwidth is set to `double'). If
I press F8 once or have environment variable LANG set to something like
"en", "Courier New" will be used instead (and ambiwidth is set to
`single').

Best regards,

Yongwei