vim not working under iTerm2 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

EDIT


iTerm2 version: Build 1.0.0.20120724 (very latest)
running with env TERM=xterm vim and env TERM=xterm-256color vim does not help
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 :)