Cursor disappears in vim when switching windows between vertical and horizontal split

cursorsplitvim

I've been switching some windows in VIM from vertical to horizontal splits and back using:

CTRL-W + K
CTRL-W + L
CTRL-W + J
CTRL-W + H

After doing this a few times the cursor disappeared. I can still type, and the status bar at the bottom still shows me my location, but there's no blinking cursor. Any ideas regarding:

  1. Why does this happen?
  2. How do I get the cursor back?

I'm using vim 7.2 on Linux

Best Answer

I have the same problem and I have used couple of work-arounds that work for me:

  1. Maximize gvim window and then click on the maximize button again to bring it to original size. This brings back the cursor.
  2. Run some shell command e.g., !echo > /dev/null - this seems to bring back the cursor as well.

I am experimenting whether doing the following (remove the left side scroll bar completely) fixes this problem completely or not - this seems to work in limited experiments but the jury is still out on this :)

set guioptions-=L

set guioptions=-l

Osho