0

While editing vim sometimes doubles characters. That is, while typing, some characters APPEAR twice. If I try to delete, vim deletes the characters in a different order than they appear. If I do not delete but save the file, quit vim, reopen the file, I can see that in fact there was no doubling of characters, it just appeared like that.

Tried setting notimeout, and also setting backupdir on local a directory but the problem remains.

Also while I am moving around in normal mode with hjkl, sometimes the given character appears in the terminal, ie. I am pressing 'j' several times moving the cursor down, and it leaves behind a trail of 'j' characters, which are in fact not written into the file, I see them only in the terminal, closing vim and reopening the file solves the problem temporary.

It is fairly annoying because I can't type a line of code or move a page down without experiencing this problem.

I am using Ubuntu 10.10 with:

  • gnome-terminal 2.32.0
  • curlftpfs 0.9.2
  • libcurl/7.21.0
  • fuse/2.8
slhck
  • 235,242
Ashnur
  • 115

1 Answers1

0

I had this problem recently. In my case, the symptoms were:

  • the hjkl characters, or escape sequences associated with the cursor keys, appear when moving in Command mode

  • lines would corrupt in Command and Insert modes, it appears as if the lines are not updating properly.

These effects don't occur in gVim, but do occur regardless of terminal emulator used.

I was using a Vim configuration that I downloaded – it defined a function that ran a shell command that returned which git branch the file was from. The output would printed onto the status bar. However, I don't have git installed, so this always raised an exception. Removing the function completely solved my problem.

The errors only occur when the screen changes, which is when this function is called. I think constantly invoking the shell and having it return an exception every time you press a key is slowing the terminal emulator down enough to prevent it updating properly. The errors occurred more frequently when I had many open Firefox tabs, or I hold down the hjkl or cursor keys.

To solve, try disabling any functions in your .vimrc file that invoke the shell, are likely to raise exceptions, or be time-consuming.

slhck
  • 235,242