>
> On 6 Oct, 21:54, Tony Mechelynck<antoine.mechely...@gmail.com> wrote:
> [...]
>> Did you read the Vim Tips Wiki link I gave you?
>> http://vim.wikia.com/wiki/Working_with_Unicodeand in particular
>> http://vim.wikia.com/wiki/Working_with_Unicode#What_the_above_does
>>
>> Vim is largely cross-platform, but the various OSes have different
>> idiosyncrasies, and in particular, different customs about setting
>> locales: for instance, under Linux I see en_US.UTF-8 as my locale, but
>> under Windows it used to be French_Belgium.1252, which means an fr_BE
>> locale using the Windows-1252 charset. For some reason Windows requires
>> the charset part of the locale to be numeric (the "code page" for
>> Unicode is 10646 IIUC, and I'm not sure whether that means UTF-8 or
>> UTF-16le). Vim will use UTF-8 internally if 'encoding' is set to some
>> variant of UTF-16 or UTF-32, because these use a lot of null bytes as
>> part of the words or doublewords representing non-null codepoints, and
>> that is incompatible with the null-terminated C strings used by Vim; but
>> if 'fileencoding' is empty, Vim will use the actual value of 'encoding'
>> even if that means converting between UTF-8 (used internally in place of
>> something else) and, let's say, UTF-16le (used on disk).
>>
>> So Vim for Linux will often work in Unicode "out of the box" because
>> that's what the OS had already set, while Vim for Windows has to set it
>> explicitly. But a common vimrc will, in this respect, work for both (it
>> did for me, when I was running double-boot W98 and Linux).
>
> Yes, I did it before I posted my original question here. Thank you
> very much again.
> Unfortunately I must be very stupid because I still don't get it.
>
>> About the differences between :set, :setglobal and :setlocal, see
>> :help set-option " (the whole list of commands)
>> :help set-verbose
>> :help local-options
>> :help :setlocal
>> :help :setglobal
>> :help global-local
>>
>> With Vim, everything is in the help, but sometimes you get a kind of
>> needle-and-haystack feeling out of it. See the first 150 or so lines in
>> :help helphelp.txt about how to domesticate that feeling.
>
> I read the help immediately, I didn't know about that before. This one
> was easy :)
>
>>
>>> On a related note: is it possible to set different fonts in
>>> different vim windows/tabs within a single application window? (I
>>> could define an autocommand to restore the default font, but there is
>>> another situation in which this would not be a solution).
>>
>> No. In gvim the 'guifont' option is global, and in Console Vim the font
>> is set by the underlying terminal to a single font for the whole screen.
>
> I see. Actually, the 'only' thing I find annoying is the following:
> I am comfortable with a 9pt font for English and German, but I need
> something bigger for Japanese. When I work with Japanese and Western
> languages simultaneously (in different windows) I have to manually
> change the font every time that I switch from a window with Japanese
> text to another one with English, and viceversa.
> Never mind. I'm suspecting I will be able to read minuscule kanjis
> long before I am able to understand the inner workings of vim and its
> encoding mysteries.
>
Well, you might add the following in your vimrc:
if has('gui_running')
if has('gui_gtk2')
set gfn=DejaVu\ Sans\ Mono\ 9
map <F9> :set gfn=FZFangSong<Bslash> 12<CR>
map <S-F9> :set gfn=DejaVu<Bslash> Sans<Bslash> Mono<Bslash> 9<CR>
elseif has('x11')
set gfn=-*-lucidatypewriter-medium-r-normal-*-*-90-*-*-m-*-*
map <F9> :set gfn=-*-fangsong-medium-r-normal-*-*-120-*-*-m-*-*<CR>
map <S-F9>
\ :set gfn=-*-lucidatypewriter-medium-r-normal-*-*-90-*-*-m-*-*<CR>
else
set gfn=Courier_New:h9:cDEFAULT
map <F9> :set gfn=MS_Mincho:h12:cDEFAULT<CR>
map <S-F9> :set gfn=Courier_New:h9:cDEFAULT<CR>
endif
endif
The continuation line (the line whose first nonspace is a backslash)
near the middle is to ensure that this code snippet won't be scrambled
by "beautifying" mail clients. You may leave it as-is.
I've tried to mention fonts usually installed on the appropriate
platforms, but you may have to experiment, especially if ever you find
yourself on non-GTK2 gvim for X11. Also, for the sake of simplicity, the
above omits kvim (which is long obsolete) and gvim with Photon GUI
(which I think you have less chance of encountering). It also omits
MacVim (which I don't know how to handle). The order of the if / elseif
/ else parts is important because gvim for GTK2 runs on X11 but requires
a different 'guifont' setting than "other" gvim builds for X11.
With the above mappings (or similar ones), in gvim, hit F9 (in Normal
mode) to set "CJK font", Shift-F9 for "Latin font". You may or may not
have to change 'lines' and 'columns' manually afterwards, or to maximize
gvim.
Best regards,
Tony.
--
CART DRIVER: Bring out your dead!
LARGE MAN: Here's one!
CART DRIVER: Ninepence.
BODY: I'm not dead!
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment