tags:

views:

420

answers:

6

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

+2  A: 

I've noticed this a few times in gvim on Ubuntu. Haven't got an idea of what causes it but sourcing vimrc again seems to solve it.

Ben
+1 - This worked for me today.
jslatts
A: 

I tried sourcing .vimrc and that didn't help.

I noticed that the blinking cursor is available if I launch (g)vim with a -O option and my files, rather than load a single file then do a split and load via :vspl filename.

Greg
+1  A: 

I've noticed that when you open gvim without any files and then use :e and :vsplit you never lose the cursor.

Qri
A: 

I'm having the same problem, using vim72 and compiled with enable-gui=gtk. I think it worked fine when i used gtk2 (at least with vim-gvim slakware package for slackware 13.0). Also I have --enable-multibyte, if that would be an issue for some reason.

Anyone having an idea of why this happens?

/anton

Henrik Antonsson
A: 

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

Osho
A: 

You can try CTRL+L to redraw the screen.

too much php