On 4/26/06, Dave Roberts <[EMAIL PROTECTED]> wrote:
Yakov Lerner wrote:
> On 4/25/06, Dave Roberts <[EMAIL PROTECTED]> wrote:
>
>> I find that if I'm in "latin1" and (in insert mode) type ctrl-v alt-n to
>> insert the character then get get out of insert mode and put the cursor
>> on the character and use "ga" to see what it is I get <M-n> but if I do
>> the same thing when the encoding is "cp437" I get <M-^L>.
>>
>
> For me, the sequence i ctrl-v alt-n <Left> <C-O>  ga results
> in exactly same thing:
>     <î>  <|n>  <M-n>  238,  Hex ee,  Octal 356
> This is vim7.0f
> I used command :set encoding=8bit-cp437 to change encoding.
>
> Some useful info is missinf in your email.
>
> 1. Do you toggle some other settings besides 'encoding' when
> you switch between the two encodings ? What is exact sequence of
> commands that you use to switch encodings ?
>
> 2. What is your vim version, and OS ? Console vim or gui vim ?
>
> Yakov
>
>

WinXP, GVIM 7.0f.

Perform the following steps:

1. GVIM -u NONE -U NONE<cr>
2.:set nocompatible<cr>
3. Cut and past the following to the command line (all one line)

nmap <silent> <S-F5>     :if exists("g:save_encoding") \| exe "set
encoding=" . g:save_encoding \| unlet g:save_encoding \| else \| let
g:save_encoding=&encoding \| set encoding=8bit-cp437 \| endif<CR>:echo
&encoding<CR>

4. Enter the following key sequence from normal mode (I'm using "Alt-"
instead of "M-" in the keystrokes) (obviously everything between '<' and
'>' is a key or key-combination - not a literal less than or greater than):

i<C-v><Alt-n><CR><ESC><S-F5>i<C-v><Alt-n><ESC>

5. Use k to go up to the first line and ga shows the character is <M-n>

6. Use j to go to the second line and ga shows the character is <M-^L>

That's what I get anyway...

Note: My default is latin1 (not using $LANG). When I press S-F5 the
command line toggles between "cp437" and "latin1".

I confirm it. Alt-N is interpreted differently by vim depending
on 'set encoding'.  I'd like to test it on Linux gvim but at the moment,
I can't.

Yakov

Reply via email to