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

11,633

Solution 1

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

Solution 2

:colorscheme <you colorscheme>

Gets cursor back for me.

Solution 3

It's logged as a bug against Ubuntu (although it also occurs in Fedora) https://bugs.launchpad.net/ubuntu/+source/vim/+bug/616858

From the bug report, two other workarounds:

  • disabling the mousehide option (:set nohousehide) stops the bug from appearing
  • double-clicking to highlight a word causes the cursor to appear again.

Hope this helps.

Solution 4

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.

Solution 5

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

Share:
11,633
Nathan Fellman
Author by

Nathan Fellman

SOreadytohelp

Updated on June 21, 2022

Comments

  • Nathan Fellman
    Nathan Fellman almost 2 years

    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