jtsao22
jtsao22

Reputation: 1972

Vim garbled text

I'm having a problem with Vim (I've had it many times before, and now I finally must post it). I don't believe its just a vim thing, but maybe a combination with running it on ssh. Here is a video showing my problem:

http://screencast.com/t/gGoOuJ7wcLA5

I didn't know a way to explain it, so I took the video. If you can't tell, in the video all I do is move my cursor up and down with the j and k keys for vim. For some reason, vim adds on other { signs when my cursor is over the { sign. Vim garbles a lot of other code that I write too, but I'm hoping this example is good enough. Btw, vim does not actually change this. If I quit vim and reopen the text, the characters written are not there. Could it have anything ot do with my $TERM? I have xterm-256color. I've tried xterm originally too.

I'm running this in iTerm on Mac OSX Lion 10.7 accessing a machine over ssh with a Debian OS.

Upvotes: 4

Views: 3590

Answers (2)

jtsao22
jtsao22

Reputation: 1972

The problem was that the $TERM in in the Debian OS I was accessing was different than the $TERM for iTerm. Once I made them the same (xterm-256color in my case), the weird problem I had went away.

In case anyone doesn't know how to change that, I ran the following command in my Debian/Ubuntu machine:

export TERM=xterm-256color

and for iTerm on Mac, I went to Preferences -> Profiles -> Terminal -> Report Terminal Type -> Choose xterm-256color or xterm.

Since the check for TERM is done at the beginning of logging onto ubuntu, you may want to include the export command into your bashrc (or equivalent file for another terminal shell).

Upvotes: 3

Balint
Balint

Reputation: 1415

Does :redraw! remove the rubbish characters?

If so, I would try to solve your problem by trying to download the source of the matchparen.vim plugin (easy to find on google), add redraw! to it, just after the critical bit, where it says "setup match highlighting" and try to load it and use it instead of the original one.

Upvotes: -2

Related Questions