rhysd / clever-f.vim

Extended f, F, t and T key mappings for Vim.
https://rhysd.github.io/clever-f.vim
1.01k stars 44 forks source link

Guicursor is overwritten with neovim #46

Closed chinleung closed 5 years ago

chinleung commented 5 years ago

I have the following to change my cursor from a block into an underline:

set guicursor=a:hor20-Cursor

Whenever I run df to delete a range, my cursor is changed back to a block.

I have to source my config to have it as an underscore again.

This behaviour seems to happen only with Neovim and not Vim itself.

rhysd commented 5 years ago

It's actually an intended behavior due to #44. I understood what is happening.

When running f as text object such as dfx, exact detailed sequence is as below

  1. User input d
  2. Neovim changes cursor shape to under bar
  3. User input f
  4. clever-f changes guicursor shape for hiding cursor
  5. User input x
  6. clever-f changes guicursor to default

The problem is that clever-f cannot know what the previous cursor shape was because Neovim already changed the cursor shape to under bar. This does not happen on Vim because Vim does not change cursor shape on d.

chinleung commented 5 years ago

Is there a way for me to disable this? Or change it back to the guicursor of my source?

rhysd commented 5 years ago

Please use following configuration.

let g:clever_f_hide_cursor_on_cmdline = 0
rhysd commented 5 years ago

I think using guicursor to hide cursor would not be a good way. Instead, changing Cursor color to the same as Normal might do the same thing. winhighlight might help. I'll check it.

chinleung commented 5 years ago

@rhysd I used the configuration you've provided and it's working for me. My cursor stays the same. :)

Thanks!