Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 279
Nathan Fellman Avatar asked Jun 22 '09 06:06

Nathan Fellman


People also ask

How to switch between Vim split windows?

To move between splits first press Ctrl-w (I remember this by Control Window, I'm not sure what the official mnemonic is) Then press a directional key to move the cursor to the split you're interested in. Directional key could be the arrows or my preferred home row method.

How to navigate split Vim?

To split the vim screen horizontally, or open a new workspace at the bottom of the active selection, press Ctrl + w , followed by the letter 's' . In the example below, the left section has been split into two workspaces. To navigate to the bottom section hit Ctrl + w , followed by the letter 'j' .

How do I stop my cursor from blinking in Vim?

Disabling cursor blinking :set guicursor=n-v-c:block-Cursor/lCursor,... After the first colon, add " blinkon0- " so it reads: :set guicursor=n-v-c:blinkon0-block-Cursor/lCursor,...


1 Answers

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

like image 65
Osho Avatar answered Oct 25 '22 13:10

Osho