Tuesday, June 14, 2022

Re: Cursors

Tony Mechelynck wrote:

> On Wed, Jun 15, 2022 at 1:50 AM rob <drrob100@fastmail.com> wrote:
> >
> > I use vim on windows and Linux.
> >
> > How do I change the cursor shape between insert and normal modes? I don't want overstrike mode
> >
> > Thx
> >
> > --
> > rob
> > Vim@drrob1.com
>
> Changing the cursor shape works fully in gvim (all platforms) and for
> height but not width in the Windows console (aka Dos Box). In
> non-Windows console Vim (for instance in xterm) Vim cannot change the
> cursor shape, its shape must be set in the underlying console. In all
> cases the relevant setting is the 'guicursor' option, even in Windows
> non-GUI Vim.
>
> See :help 'guicursor'
>
> Best regards,
> Tony.

It should be possible to honor 'guicursor' option in the terminal though
in theory, just like the terminal can now honor 'guicolors' with
`termguicolors`.

Many terminals support setting the shape of the cursor.
Try e.g. this in your terminal which I found at
https://stackoverflow.com/questions/4416909/anyway-change-the-cursor-vertical-line-instead-of-a-box

$ echo -e -n "\x1b[\x30 q" # changes to blinking block
$ echo -e -n "\x1b[\x31 q" # changes to blinking block also
$ echo -e -n "\x1b[\x32 q" # changes to steady block
$ echo -e -n "\x1b[\x33 q" # changes to blinking underline
$ echo -e -n "\x1b[\x34 q" # changes to steady underline
$ echo -e -n "\x1b[\x35 q" # changes to blinking bar
$ echo -e -n "\x1b[\x36 q" # changes to steady bar

I don't use neovim, but I recall trying it and noticing that it did
support 'guicursor' in the terminal unlike vim.

If I look at neovim help file options.txt, it says:

=== BEGIN QUOTE https://neovim.io/doc/user/options.html#'guicursor'
*'guicursor'* *'gcr'* *E545* *E546* *E548* *E549*
'guicursor' 'gcr' string (default "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20")
global

Configures the cursor style for each mode. Works in the GUI and many
terminals. See |tui-cursor-shape|.
=== END QUOTE


Whereas for Vim, :help 'guicursor` says that it's for the GUI only:

=== BEGIN QUOTE https://vimhelp.org/options.txt.html#%27guicursor%27
'guicursor' 'gcr' E545 E546 E548 E549
'guicursor' 'gcr' string (default "n-v-c:block-Cursor/lCursor,
ve:ver35-Cursor,
o:hor50-Cursor,
i-ci:ver25-Cursor/lCursor,
r-cr:hor20-Cursor/lCursor,
sm:block-Cursor
-blinkwait175-blinkoff150-blinkon175",
for Win32 console:
"n-v-c:block,o:hor50,i-ci:hor15,
r-cr:hor30,sm:block")
global
{only available when compiled with GUI enabled, and
for Win32 console}
=== END QUOTE

Regards
Dominique

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAON-T_hAJF%3DNKkyiqypA-T8h%3DWj2ut1oq7PwkkaWes6G8fjsJw%40mail.gmail.com.

No comments:

Post a Comment