diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-10-17 11:16:16 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2024-10-21 00:54:43 +0200 |
commit | 18b43c331d8a0ed87d7cbefe2a18543b8e4ad360 (patch) | |
tree | 6cc88b23ade96b1804aeb1ef0870252c293d2878 /runtime/doc/lua.txt | |
parent | 960fdc775a88389d8b19389b8c74c98921b9acac (diff) | |
download | rneovim-18b43c331d8a0ed87d7cbefe2a18543b8e4ad360.tar.gz rneovim-18b43c331d8a0ed87d7cbefe2a18543b8e4ad360.tar.bz2 rneovim-18b43c331d8a0ed87d7cbefe2a18543b8e4ad360.zip |
refactor: rename vim.highlight => vim.hl
Problem:
- `vim.highlight` module does not follow `:help dev-name-common`, which
documents the name for "highlight" as "hl".
- Shorter names are usually preferred.
Solution:
Rename `vim.highlight` to `vim.hl`.
This is not a breaking change until 2.0 (or maybe never).
Diffstat (limited to 'runtime/doc/lua.txt')
-rw-r--r-- | runtime/doc/lua.txt | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index aba1ef476b..280e9ebf79 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -636,13 +636,13 @@ A subset of the `vim.*` API is available in threads. This includes: ============================================================================== -VIM.HIGHLIGHT *vim.highlight* +VIM.HL *vim.hl* -vim.highlight.on_yank({opts}) *vim.highlight.on_yank()* +vim.hl.on_yank({opts}) *vim.hl.on_yank()* 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} + autocmd TextYankPost * silent! lua vim.hl.on_yank {higroup='Visual', timeout=300} < Parameters: ~ @@ -655,9 +655,9 @@ vim.highlight.on_yank({opts}) *vim.highlight.on_yank()* true) • event event structure (default vim.v.event) • priority integer priority (default - |vim.highlight.priorities|`.user`) + |vim.hl.priorities|`.user`) -vim.highlight.priorities *vim.highlight.priorities* +vim.hl.priorities *vim.hl.priorities* Table with default priorities used for highlighting: • `syntax`: `50`, used for standard syntax highlighting • `treesitter`: `100`, used for treesitter-based highlighting @@ -666,8 +666,8 @@ vim.highlight.priorities *vim.highlight.priorities* • `user`: `200`, used for user-triggered highlights such as LSP document symbols or `on_yank` autocommands - *vim.highlight.range()* -vim.highlight.range({bufnr}, {ns}, {higroup}, {start}, {finish}, {opts}) + *vim.hl.range()* +vim.hl.range({bufnr}, {ns}, {higroup}, {start}, {finish}, {opts}) Apply highlight group to range of text. Parameters: ~ @@ -684,8 +684,7 @@ vim.highlight.range({bufnr}, {ns}, {higroup}, {start}, {finish}, {opts}) • {inclusive}? (`boolean`, default: `false`) Indicates whether the range is end-inclusive • {priority}? (`integer`, default: - `vim.highlight.priorities.user`) Indicates priority of - highlight + `vim.hl.priorities.user`) Highlight priority ============================================================================== |