Question

The problem is not solved although I accepted one answer.

Problem: Vim updates very slowly the screen in Screen in Mac, although lazyredraw and showcmd are off.


The line numbers get on the foldColumn as below, for instance, when I have line numbers alt text http://dl.getdropbox.com/u/175564/vimScreenFold.png

When I have nothing in my .vimrc, the problem can be seen by multiplied comment lines on top of one another: alt text http://dl.getdropbox.com/u/175564/vimScatteredBug.png

I did not type the following comment more than once on the left-hand side

"set list...

Observations

  1. seemed to occur only in comment lines and empty lines. However, I got the evidence (2) which shows that this is not the case.
  2. scatters occurs mostly in the left-hand-side window. They occur also with a single window. However, it is harder to detect with it.
  3. The bug occurs slightly differently when I have nothing in .vimrc. However, the "stagnation" occurs in both situations: with empty .vimrc and with non-empty .vimrc.

Identification of Bug

Dependent variables

  1. dependent on comment signs automatically put by Vim. I noticed disappeared pixels when Vim put Python's comment signs # automatically to my files, when it could not show the whole file.
  2. dependent on at least OS/X Leopard.

Independent variables

  1. file independent: occurs in all files edited by Vim
  2. line independent: occurs in a Python code without comments and empty lines
  3. .vimrc independent: occurs with empty .vimrc
  4. .screenrc independent: occurs with empty .screenrc
  5. shell independent: occurs with Bash and Zsh
  6. Screen version independent: occurs with Leopard's default screen and with Screen 4.0.3
  7. independent of different comment characters: occurs when scrolling down, for instance, .zshrc, .vimrc and .screenrc

How can you disable Vim's default settings?

Was it helpful?

Solution

I'm guessing that the issue might be with your termcap and terminfo settings. Try commenting those out from your screenrc, and restarting screen.

Also, what (non-virtual) terminal are you using?

Ah, it looks like you're using OSX's Terminal.app, which is exactly what I use (with screen/zsh/vim). /usr/bin/screen should work with /usr/bin/vim with an empty .screenrc and .vimrc by default.

% touch empty_screenrc
% cat empty_screerc
% /usr/bin/screen -c empty_screenrc
#...and within screen
% /usr/bin/vim -u NONE

If the problem still persists, the problem may be in your shell. But if this fixes the problem, I'd suggest posting your ~/.vimrc to aid in further diagnosis.

OTHER TIPS

I think that the OS X default version of screen does not support 256 colors. You can set vim to use a lower number of colors in your .vimrc file:

set t_Co=16

On Mac OS X you can rebuild screen to use 256 colors, see here: http://pjkh.com/articles/2008/07/09/osx-iterm-screen-vim-256-colors.

Here's the short version of the instructions:

Rebuild screen making sure to include the 256 colors option:

./configure --enable-colors256

Then you will need to add the following to your ~/.screenrc:

# terminfo and termcap for nice 256 color terminal
# allow bold colors - necessary for some reason
attrcolor b ".I"
# tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# erase background with current bg color
defbce "on"

Source

I have no plugins and nothing in in .vimrc and .screenrc. The problem still persists.

Identification of bug

  1. file independent: occurs in all files edited by Vim

The "stagnation" seems to occurs mostly in comment lines and empty lines. However, the bug occurs also without comments and empty lines, but the impact of it seems to much smaller.

Picture for the observation 2 alt text http://dl.getdropbox.com/u/175564/cruxMoveInVimScattered.png

I had this problem (just painfully slow) and it ended up being the Consolas font I was using in Terminal.App and ITerm. In my case switching to the Monaco sped things up considerably.

Crux move: the bug seems to occur because some of Vim's default options cause the problem

I use my default configs in .vimrc and .screenrc now, since I observed that they do not cause the bug.

The bug seems to be slighly comment and empty line dependent. I got an evidence of it.

I have no comments and no empty lines in my Python code. However, I noticed that when Vim cannot show full lines, it puts comment marks to my code. For example, notiche the three # -marks, which Vim put there.

This caused the disappeared pixel.

alt text http://dl.getdropbox.com/u/175564/pythonBug.png


The bug seems to occur in the same file when I cannot see the comment signs automatically put by Vim.

alt text http://dl.getdropbox.com/u/175564/counterExample.png

I duplicated by purpose the code for the picture such that you can see the disappered pixels clearly.

I noticed once when I was playing with the Python code that the "stagnation" occurred greatly after I put a single empty line to the code. However, I have not managed to duplicate the event.


Unsuccessful Attempts to solve the bug by .vimrc

  1. to disable comments signs set automatically by Vim

    set formatoptions-=c

It looks like there are some known issues relating to wrap mode for OS X, see number 1. here. It suggests a workaround.

I've had similar problems with irssi and bash, which were caused by colour codes not closed correctly..

Have you tried a different vim theme (specifically the default one), or running :syntax off ?

Debugging:

One suggested me to freeze my terminal from the changes of other applications by

ttyctl -f

However, it did not seem to solve the problem. Nevertheless, it may help us to find the bug, since we do not have other apps changing the situation now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top