Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional cursorword highlighting in insert mode #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

noelevans
Copy link

Cursorword highlighting may not be desired when in insert mode. When cursorword highlighting uses fg and bg options particularly, the highlighting of the current word feels distracting. For example if the user is typing the word "return", highlighting triggers for "ret", "retu", "retur" and finally "return". Attaching example screenshot to ticket.

Cursorword highlighting may not be desired when in insert mode. When
cursorword highlighting uses fg and bg options particularly, the
highlighting of the current word feels distracting. For example if the
user is typing the word "return", highlighting triggers for "ret",
"retu", "retur" and finally "return". Attaching example screenshot to
ticket.
@noelevans
Copy link
Author

Here is cursorword highlighting while typing a return statement (in the main code) which for my use feels a bit distracting:
image

It then works as desired once the word is completed and normal mode is active:
image

The above screenshots are using these settings

require("nvim-cursorline").setup({
  cursorline = {
    enable = false,
  },
  cursorword = {
    enable = true,
    min_length = 1,
    hl = {
      fg = "#c0caf5",
      bg = "#565f89",
      underline = false,
    },
  },
})

@noelevans
Copy link
Author

Hi @yamatsum so I'm proposing this change which would make highlighting of the current word in insert mode as optional, defaulting to the current behavior (actively highlighting). I would like to be able to turn off insert mode highlighting. I wondered if you'd accept this PR to make that possible. Many thanks, Noel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant