In Insert mode, when I press End I get an F where the cursor is and Insert mode is canceled. This works on one system and not another. I have checked what is installed (vim, vim-common, vim-runtime,vim-tiny) and the version (both are 2:7.4.1689-3ubuntu1.3) as well as what vi and vim point to (both point to /usr/bin/vim.basic). /etc/vim/vimrc* are identical as is .vimrc (set no compatible and colorscheme torte). What else do I check?

  • Is there a difference in what $TERM is set to in the shell? How about :set term? inside Vim? How about :set t_@7? t_kh? (these are the terminfo/termcap codes for the "End" and "Home" keys...)
    – filbranden
    Mar 1 '20 at 4:44
  • 1
    Thank you so much - this is the answer to my question (post it as an answer, I'll accept it). $TERM was set to linux, changing it to xterm-256color solved my problem (didn't try any other settings). Mar 9 '20 at 2:57

This is a problem with how $TERM is set in your system.

On the problem system, you had it as TERM=linux, which is applicable to the Linux console and uses different escape sequences for the special keys than the xterm settings.

Setting it to TERM=xterm or TERM=xterm-256color or similar should fix it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.