Duddy67
Duddy67

Reputation: 1046

Vim: change the cursor shape in overtype mode?

In my vimrc file I put the following code in order to change the cursor shape:

if &term =~ "xterm"
  " blinking vertical bar
  let &t_SI .= "\<Esc>[5 q"
  " blinking block
  let &t_EI .= "\<Esc>[1 q"
endif

It works great but now I'd like to take it further and change also the cursor shape (blinking underscore) whenever the overtype mode is used (r and R keys). How could I achieve this ?

Thanks

Upvotes: 0

Views: 905

Answers (2)

pacha
pacha

Reputation: 3007

You can use t_SR for that. For example, to get an underscore as you suggest, your configuration would look like:

if &term =~ "xterm"
  " blinking vertical bar
  let &t_SI .= "\<Esc>[5 q"
  " blinking block
  let &t_EI .= "\<Esc>[1 q"
  " blinking underscore
  let &t_SR .= "\<Esc>[3 q"
endif

Upvotes: 1

Thomas Dickey
Thomas Dickey

Reputation: 54533

Vim does not support this. To see that, look at the term_cursor_shape() function in term.c. That provides the shape for insert/non-insert which you are already using (as extensions to termcap).

Other termcap symbols which vim uses are the conventional flavors of invisible (vi), normal (ve) and very visible (vs). But vim uses those to handle a quirk of scrolling.

Reading further, the only place where vim appears to make the replace-status visible is in the showmode() function in screen.c

Upvotes: 0

Related Questions