From 3ad0d61c1a9b3a645c73453d017bcfe68500bc97 Mon Sep 17 00:00:00 2001 From: Omri Sarig Date: Sat, 19 Apr 2025 13:35:56 +0200 Subject: [PATCH] fix: rename vim.highlight.on_yank to vim.hl.on_yank The functions of vim.highlight were renamed to vim.hl on commit 18b43c331d8a0ed87d7cbefe2a18543b8e4ad360 of neovim, which was applied with the release of nvim version 0.11. Now, the use of vim.highlight is deprecated, and instead, one should use vim.hl functions. In practice, vim.highlight is still working, however, asking for help for vim.highlight.on_yank fails (E149), while asking for help for vim.hl.on_yank works as expected. So, by updating the used function, a new user will have easier time looking getting the relevant help. --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 776c6873ff6..2b6db127e49 100644 --- a/init.lua +++ b/init.lua @@ -205,12 +205,12 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win -- Highlight when yanking (copying) text -- Try it with `yap` in normal mode --- See `:help vim.highlight.on_yank()` +-- See `:help vim.hl.on_yank()` vim.api.nvim_create_autocmd('TextYankPost', { desc = 'Highlight when yanking (copying) text', group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), callback = function() - vim.highlight.on_yank() + vim.hl.on_yank() end, })