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

Does not trigger autocmd TextYankPost #261

Open
qalshidi opened this issue Oct 30, 2020 · 1 comment
Open

Does not trigger autocmd TextYankPost #261

qalshidi opened this issue Oct 30, 2020 · 1 comment

Comments

@qalshidi
Copy link

Hi,

I have this snippet in my vim settings:

" Flash highlighted text
if exists('##TextYankPost') && has('nvim-0.5')
  au TextYankPost * ++nested silent! lua vim.highlight.on_yank {timeout=200, on_visual=false}
endif

TextYankPost exists in Vim 8 as well. I realized that I don't get a highlight
when I yank using targets.vim. Is there any way to call a function on yank with
targets.vim? Or am I missing something?

Thanks

@ojroques
Copy link

It seems targets.vim uses visual mode to set the text objects. So if you set on_visual to true you should get the highlights back.

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

No branches or pull requests

2 participants