Re: Mac Terminal.app, utf-8 and vim
- Le 3 déc. 05 à 19:07, Jussi Hagman a écrit :
> In french keymap "^", l'accent circumflex, is not a real character
> but a "soft" or "silent" key. Therefore when pressing it no
> character is actually created but an intermediate underlined "^"
> shown to provide the user with some feedback. As far as I know this
> is done by Terminal.app, not vim or another program running. If a
> suitable character, for instance an "a", is given immediately after
> this a "â" is produced and sent to vim.
>> If, instead, I hit "^" a second time, the character doesn'tYou are right, I hadn't noticed that.
>> dissappear, and the cursor goes to the beginning of the line,
>> repacing the first character of the line by "^" (so I actually see
>> two "^" on my line at this stage).
>> Then, if I hit any key, the character "^" at the beginning of the
>> line disappears, but not the one that had appeared first elsewhere
>> in the line.
> This is quite interesting phenomenon, but I'd say this is a bug in
> Terminal.app, not in vim. If you press ctrl-l to force a redraw you
> see that the line has the expected characters.
> Terminal.app just seems to loose it if cursor is moved when it isYes, this wouldn't be reasonnable. Since apple ships vim with tiger,
> not expecting it.
> I tried this also with iTerm, which is another terminal for OS X.
> It seems to handle the silent characters differently, in a less
> buggy way. I guess we could work around this bug by redrawing the
> line when "^" command is issued but I'd be very hesitant to see an
> OS X specific fix in vim to work around a Terminal.app bug.
it might want to improve its termina.app, so that vim works correctly
with it (using any keymap). Maybe I'll try submitting this to apple
as a bug, if I find a place to do it.
Thank you for your answer.
- Hi Benji,
Ah yes, I almost missed that request. Of course, here you are:
Q: How can I use national characters when running vim in a Terminal
window? I get funny characters or extra white space!
A: Go to Terminal.app -> Menu Terminal -> Window Settings. Select
Emulation from the Popup menu, un-check the item Escape non-ASCII
characters (terminal sends ctrl-V for quoting). Then select Display
from the Popup menu, set Character Set Encoding to Unicode (UTF-8),
if desired. Click on "Use settings as Default."
At last, vim defaults to "set encoding=latin1". To use Unicode
instead, add the following line to your .bashrc, then open a new shell:
Am 03.12.2005 um 17:38 schrieb Benji Fisher:
> On Fri, Dec 02, 2005 at 09:20:50PM +0100, Peter Vohmann wrote:
>> Jussi Hagman wrote:
>>>> When I type "ä" into vim on the mac, I get "Ã¤" instead. You've
>>>> heard it before, right?
>>> Actually I had not but I could reproduce after a little tinkering.
>> I found it on the mail archive of this very list. ;-)
>>> You should setup the Terminal.app so that it would not escape non-
>>> ascii characters. (uncheck terminal -> window settings -> emulation
>>> -> escape non ascii chars and save that as defaults)
>> That's it. THANK YOU!
> Now that you have the answer, if you write it up as a Q&A, I will
> add it to the list at http://macvim.org/OSX/index.php#FAQ .
> --Benji Fisher