VIM 7.3 Problem with F1-F10 in terminal ubuntu 10.10

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

VIM 7.3 Problem with F1-F10 in terminal ubuntu 10.10

markus1189
Hi,

i have a really strange problem:

When i use vim in the console, the f1-10 is somehow broke:

F1 inserts P
F2 inserts Q
F3 inserts R
F4 inserts S

F5-10 inverts the case

This is really annoying...
Somehow this bug does not occur with gvim

I even tried it with a clean vimrc but no difference...

Maybe the problem is my compiled version of VIM 7.3?

Any help is very appreciated
Reply | Threaded
Open this post in threaded view
|

Re: VIM 7.3 Problem with F1-F10 in terminal ubuntu 10.10

John Little-4

> When i use vim in the console, the f1-10 is somehow broke:
>
> F1 inserts P

Your $TERM setting does not match the console.  By console, I thought
you meant what I get when I type ctrl-alt-f1, but I've got doubts
because in my console the escape sequence for F1 is <esc>[[A, but your
F1 is giving the old vt100 <esc>OP; perhaps you mean konsole, not
console?  Or some other terminal emulator?  (Ubuntu's usual terminal
emulator is gnome-terminal, but for me F1 starts gnome-terminal's
help, and vim doesn't see it.)

Anyway, in the console, the one you get when not running X (the GUI)
TERM should be "linux", and in konsole and the like TERM should be
"xterm" or similar.  Also, your .vimrc could be screwing things up by
setting vim's idea of the terminal, the "term" option.  If in konsole
I start vim then
:set term=linux
I get what you get.  I'm kubuntu 10.4.  In my set up none of my shell
start up files (.bashrc, .profile, /etc/profile, /etc/bash.bashrc)
sets $TERM nor does my .vimrc set term, and it get sets correctly; I
suggest you look for TERM or term being set somewhere.  If not, please
tell us what $TERM is before you run vim, and what vim's term option
is set to, and which terminal emulator you are using.

HTH, John

--
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
Reply | Threaded
Open this post in threaded view
|

Re: VIM 7.3 Problem with F1-F10 in terminal ubuntu 10.10

bill lam
On my framebuffer term, F1 is ^[OP
I use map #1 to map #12 for mapping F1 to F12, it may also work for you.

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3

--
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
Reply | Threaded
Open this post in threaded view
|

Re: VIM 7.3 Problem with F1-F10 in terminal ubuntu 10.10

markus1189
In reply to this post by John Little-4
Actually my $TERM is always xterm and is neither changed in my .vimrc nor .bashrc

However: This fixed it for me(put it in to my vimrc):

    if !has("gui_running") && $TERM is "xterm"
        for [key, code] in [["<F1>", "\eOP"],
                            \["<F2>", "\eOQ"],
                            \["<F3>", "\eOR"],
                            \["<F4>", "\eOS"],
                            \["<F5>", "\e[15~"],
                            \["<F6>", "\e[17~"],
                            \["<F7>", "\e[18~"],
                            \["<F8>", "\e[19~"],
                            \["<F9>", "\e[20~"],
                            \["<F10>", "\e[21~"],
                            \]
            execute "set" key."=".code
        endfor
    endif