Basically, vim behaves strange under iTerm2 (it works normally in Terminal). It sets the cursor in a non existing lines, it displays garbage (content from other lines) when I try to edit a line in a file etc. It is completely useless :(

I changed "reported terminal type" to "linux" as suggested in some post, but it didn't help


  • iTerm2 version: Build (very latest)
  • running with env TERM=xterm vim and env TERM=xterm-256color vim does not help
  • Did you try to run vim with TERM=xterm vim?
    – nohillside
    Commented Aug 20, 2012 at 11:00
  • can you tell us which version of iTerm2 are your using? I am on Build (without TMux btw), and using vim VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 20 2012 13:16:02), and all works fine on iTerm2 Commented Aug 20, 2012 at 11:30
  • btw, I have report terminal type as xterm-256color, which is also specified in my bashrc as export TERM=xterm-256color Commented Aug 20, 2012 at 11:33
  • Can you upgrade iTerm2 to the latest version?
    – nohillside
    Commented Aug 20, 2012 at 11:47
  • Had this problem with iTerm 2 + screen over RS232
    – bot47
    Commented Aug 20, 2012 at 13:19

1 Answer 1


Apparently, removing set lines=40 does the trick. The manual says:

    Number of lines of the Vim window.
    Normally you don't need to set this.  It is done automatically by the
    terminal initialization code

so be careful when you copy-paste ready configs, as I did :)

You must log in to answer this question.

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