1

I am trying to set the cursor as a block/box that surrounds the current character as opposed to a line cursor:

This is my default that I got pressing :set guicursor=<Tab>

:set guicursor=n-v-c:block-Cursor/lCursor,ve:ver35-Cursor,o:hor50-Cursor,i-ci:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCurso
r,sm:block-Cursor-blinkwait175-blinkoff150-blinkon175

I tried changing lCursor to bCursor or cursor, like so:

:set guicursor=n-v-c:block...

And also

:set guicursor=n-c-v:block-nCursor

but that's not the away apparently.

I need this because the way it indicates characters at the moment doesn't reflect the white spaces in a way i understand them.


PD: I just realized that way you set it for gVim but I am not using gVim, and can't find much for vim.

Help please : - ) !!

0

1 Answer 1

1
  • For standard Vi/Vim I changed Alacritty's (terminal emulator) cursor mode from Beam to Block, and Vim takes that.

  • For gVim type :help guicursor

Or type :set guicursor= and hit Tab to autocomplete with the default value. In my case it looks like this:

:set guicursor=n-v-c:block-nCursor/lCursor,ve:ver35-Curs
or,o:hor50-Cursor,i-ci:ver25-Cursor/lCursor,r-cr:hor20-
Cursor/lCursor,sm:block-Cursor-blinkwait175-blinkoff150
-blinkon175

As you may infer the syntax is a comma separated list of <modes>:<options>.

And both modes and options can be a list of values, in this case separated by dashes -.

The first one is for normal,visual or command mode, uses a block Cursor.

So this n-v-c:block-nCursor is valid for normal, visual and command line mode, and uses the block cursor with an option nCursor which is a highlight group (no idea what this is).

Then there is a /lCursor which is an optional highlight group.

If instead of block we use ver{N} or hor{N} we convert the cursor to a line, horizontal or vertical, of a specific width.

That's more or less the idea.

3
  • Can you add to your answer the content from the page you link? This is useful in case the page you link disappears one day and it's also more convenient for future readers who will have an answer directly rather than having to search another website.
    – statox
    Mar 24 at 9:19
  • Yes, I will. @statox
    – Minsky
    Mar 24 at 9:58
  • 1
    Thank you very much! It's much better like this :)
    – statox
    Mar 24 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.