aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/lua.txt')
-rw-r--r--runtime/doc/lua.txt22
1 files changed, 11 insertions, 11 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 002fc523a1..0ee63eb523 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -711,25 +711,26 @@ VIM.HIGHLIGHT *lua-highlight*
Nvim includes a function for highlighting a selection on yank (see for example
https://github.com/machakann/vim-highlightedyank). To enable it, add
>
- au TextYankPost * silent! lua require'vim.highlight'.on_yank()
+ au TextYankPost * silent! lua vim.highlight.on_yank()
<
to your `init.vim`. You can customize the highlight group and the duration of
the highlight via
>
- au TextYankPost * silent! lua require'vim.highlight'.on_yank("IncSearch", 500)
+ au TextYankPost * silent! lua vim.highlight.on_yank {higroup="IncSearch", timeout=150}
<
If you want to exclude visual selections from highlighting on yank, use
>
-au TextYankPost * silent! lua return (not vim.v.event.visual) and require'vim.highlight'.on_yank()
+ au TextYankPost * silent! lua vim.highlight.on_yank {on_visual=false}
<
-vim.highlight.on_yank([{higroup}, {timeout}, {event}])
- *vim.highlight.on_yank()*
- Highlights the yanked text. Optional arguments are the highlight group
- to use ({higroup}, default `"IncSearch"`), the duration of highlighting
- in milliseconds ({timeout}, default `500`), and the event structure
- that is fired ({event}, default `vim.v.event`).
-
+vim.highlight.on_yank({opts}) *vim.highlight.on_yank()*
+ Highlights the yanked text. The fields of the optional dict {opts}
+ control the highlight:
+ - {higroup} highlight group for yanked region (default `"IncSearch"`)
+ - {timeout} time in ms before highlight is cleared (default `150`)
+ - {on_macro} highlight when executing macro (default `false`)
+ - {on_visual} highlight when yanking visual selection (default `true`)
+ - {event} event structure (default `vim.v.event`)
vim.highlight.range({bufnr}, {ns}, {higroup}, {start}, {finish}, {rtype}, {inclusive})
*vim.highlight.range()*
@@ -739,7 +740,6 @@ vim.highlight.range({bufnr}, {ns}, {higroup}, {start}, {finish}, {rtype}, {inclu
or blockwise, see |setreg|; default to characterwise) and whether the
range is inclusive (default false).
-
------------------------------------------------------------------------------
VIM.REGEX *lua-regex*