1

I'm having some strange issues working with vim editing files in an ssh session on a remote linux (Ubuntu 13.04 ) server. On the client side, I'm on a mac running OS 10.8.4 (late 2012 mac mini). I've googled around extensively on this and came up empty handed. I've used vim for years, and I've never seen problems like this before.

The issues all present themselves when I first load the file in vim. I've experienced the following issues:

  1. The top couple of lines are missing. Using arrow keys or the top of file shortcut, I can simply not get to these lines.

  2. Sometimes, when attempting to delete a character, an entire word or words will be deleted.

  3. The result of yank and put is inconsistent. Sometimes the line appears correctly, other times all I get is a jarbled mess.

Am I using the wrong version of vim remotely or some terminal problem specific to Mac OS?

  • 1
    What value is the TERM variable set to and is it set to a value known on the remote side? Does paging with less work, or running emacs in terminal mode? – nohillside Sep 10 '13 at 13:04
  • TERM is set to xterm-color on both the client and the server side. Paging with less or just cat'ing the file work fine. I do not use emacs, but from some brief testing today, there doesn't seem to be a problem. – steveJ_1987 Sep 10 '13 at 20:05
  • cat'ing always works, there is no terminal control involved. Nevertheless, can you try to set TERM to xterm or vt100 ? Maybe the termcap entry for xterm-color is wrong on the server. – nohillside Sep 10 '13 at 20:07
3

I would recommend changing from x-term256color to xterm for your TERM variable as that seems to have resolved my similar issues.

The things I saw (in addition to the question's symptoms) are often to have line over-flow issues within the vi session. That is if I type beyond a certain number of columns then the rest of the text is put onto the next line (i.e. with a new line \n character in place). This overflowed text is not displayed in the current vi session but I will see it after reopening.

Another problem is occasionally the cursor is displayed on one line but I will start editing the next line down..... a real pain when you are writing code!

  • Thanks. I wanted to test it for a while to make sure changing the TERM variable was the solution, and it looks like TERM=XTERM has solved the problem. – steveJ_1987 Nov 14 '13 at 23:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .