machakann / vim-highlightedyank

Make the yanked region apparent!
844 stars 22 forks source link

redefining highlight group does not wok if I put this setting in Neovim config file #35

Closed jdhao closed 6 years ago

jdhao commented 6 years ago

The document says that we can redefine the highlight group for yank:

hi HighlightedyankRegion cterm=reverse gui=reverse

But if I put this setting in the Neovim config file init.vim, source the file and open Nvim, the change does not take effect. If I open Nvim and set the highlight in the window :hi HighlightedyankRegion cterm=reverse gui=reverse , it works.

It is really weird.

machakann commented 6 years ago

Sounds strange. Could you execute the following command by hand right after opening Nvim?

:verb hi HighlightedyankRegion

It shows the file determining the highlight group. If it is plugin/highlightedyank.vim, the code in init.vim has not been loaded well. If it is the other, the highlight group has been overwritten somewhere.

jdhao commented 6 years ago

The output of command :verb hi HighlightedyankRegion is

HighlightedyankRegion xxx links to IncSearch Last set from ~/.local/share/nvim/plugged/vim-highlightedyank/plugin/highlightedyank.vim

jdhao commented 6 years ago

After existing all the nvim window and restart, the settings seem to take effect now. I don't know why, but it works now.