diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-04-30 04:30:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-30 04:30:21 -0700 |
commit | 71cf75f96a67aeb79ac3af6aa829bac81bd2d33d (patch) | |
tree | b6582df55b2956fb2077f2d79c2cc7b6acf37c84 /runtime/lua/vim/highlight.lua | |
parent | efaf37a2b9450d56acbf48a44c3c791d00d70199 (diff) | |
download | rneovim-71cf75f96a67aeb79ac3af6aa829bac81bd2d33d.tar.gz rneovim-71cf75f96a67aeb79ac3af6aa829bac81bd2d33d.tar.bz2 rneovim-71cf75f96a67aeb79ac3af6aa829bac81bd2d33d.zip |
docs: misc #24163
- Also delete old perl scripts which are not used since 8+ years ago.
fix #23251
fix #27367
ref https://github.com/neovim/neovim/issues/2252#issuecomment-1902662577
Helped-by: Daniel Kongsgaard <dakongsgaard@gmail.com>
Co-authored-by: Kevin Pham <keevan.pham@gmail.com>
Diffstat (limited to 'runtime/lua/vim/highlight.lua')
-rw-r--r-- | runtime/lua/vim/highlight.lua | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/runtime/lua/vim/highlight.lua b/runtime/lua/vim/highlight.lua index 09d3ea5707..cdc0f0a0b1 100644 --- a/runtime/lua/vim/highlight.lua +++ b/runtime/lua/vim/highlight.lua @@ -1,26 +1,3 @@ ----@brief ---- ---- Nvim includes a function for highlighting a selection on yank. ---- ---- To enable it, add the following to your `init.vim`: ---- ---- ```vim ---- au TextYankPost * silent! lua vim.highlight.on_yank() ---- ``` ---- ---- You can customize the highlight group and the duration of the highlight via: ---- ---- ```vim ---- au TextYankPost * silent! lua vim.highlight.on_yank {higroup="IncSearch", timeout=150} ---- ``` ---- ---- If you want to exclude visual selections from highlighting on yank, use: ---- ---- ```vim ---- au TextYankPost * silent! lua vim.highlight.on_yank {on_visual=false} ---- ``` ---- - local api = vim.api local M = {} @@ -97,7 +74,13 @@ local yank_ns = api.nvim_create_namespace('hlyank') local yank_timer --- @type uv.uv_timer_t? local yank_cancel --- @type fun()? ---- Highlight the yanked text +--- Highlight the yanked text during a |TextYankPost| event. +--- +--- Add the following to your `init.vim`: +--- +--- ```vim +--- autocmd TextYankPost * silent! lua vim.highlight.on_yank {higroup='Visual', timeout=300} +--- ``` --- --- @param opts table|nil Optional parameters --- - higroup highlight group for yanked region (default "IncSearch") |