mirror of
https://github.com/neovim/neovim.git
synced 2025-11-29 21:50:38 +00:00
chore: fix typos (#17331)
Co-authored-by: Hongyi Lyu <hongyi.lyu95@gmail.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: notomo <notomo.motono@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
This commit is contained in:
@@ -1079,7 +1079,7 @@ WinLeave Before leaving a window. If the window to be
|
||||
executes the BufLeave autocommands before the
|
||||
WinLeave autocommands (but not for ":new").
|
||||
Not used for ":qa" or ":q" when exiting Vim.
|
||||
After WinClosed.
|
||||
Before WinClosed.
|
||||
*WinNew*
|
||||
WinNew When a new window was created. Not done for
|
||||
the first window, when Vim has just started.
|
||||
|
||||
@@ -74,7 +74,7 @@ Functions that take a severity as an optional parameter (e.g.
|
||||
|
||||
2. A table with a "min" or "max" key (or both): >
|
||||
|
||||
vim.diagnostic.get(0, { severity = {min=vim.diagnostic.severity.WARN})
|
||||
vim.diagnostic.get(0, { severity = {min=vim.diagnostic.severity.WARN} })
|
||||
|
||||
The latter form allows users to specify a range of severities.
|
||||
|
||||
|
||||
@@ -355,8 +355,8 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method
|
||||
*lsp-handler-resolution*
|
||||
Handlers can be set by:
|
||||
|
||||
- Setting a field in |vim.lsp.handlers|. *vim.lsp.handlers*
|
||||
|vim.lsp.handlers| is a global table that contains the default mapping of
|
||||
- Setting a field in vim.lsp.handlers. *vim.lsp.handlers*
|
||||
vim.lsp.handlers is a global table that contains the default mapping of
|
||||
|lsp-method| names to |lsp-handlers|.
|
||||
|
||||
To override the handler for the `"textDocument/definition"` method: >
|
||||
|
||||
@@ -1083,7 +1083,7 @@ from within Lua.
|
||||
`vim.opt.wildignore = '*.o,*.a,__pycache__'`
|
||||
|
||||
However, vim.opt also supports a more elegent way of setting
|
||||
list-style options, but using lua tables:
|
||||
list-style options by using lua tables:
|
||||
`vim.opt.wildignore = { '*.o', '*.a', '__pycache__' }`
|
||||
|
||||
To replicate the behavior of |:set+=|, use: >
|
||||
|
||||
@@ -207,14 +207,14 @@ Here is a list of built-in predicates :
|
||||
|
||||
`eq?` *ts-predicate-eq?*
|
||||
This predicate will check text correspondence between nodes or
|
||||
strings : >
|
||||
strings: >
|
||||
((identifier) @foo (#eq? @foo "foo"))
|
||||
((node1) @left (node2) @right (#eq? @left @right))
|
||||
<
|
||||
`match?` *ts-predicate-match?*
|
||||
`vim-match?` *ts-predicate-vim-match?*
|
||||
This will match if the provided vim regex matches the text
|
||||
corresponding to a node : >
|
||||
corresponding to a node: >
|
||||
((identifier) @constant (#match? @constant "^[A-Z_]+$"))
|
||||
< Note: the `^` and `$` anchors will respectively match the
|
||||
start and end of the node's text.
|
||||
@@ -225,17 +225,18 @@ Here is a list of built-in predicates :
|
||||
|
||||
`contains?` *ts-predicate-contains?*
|
||||
Will check if any of the following arguments appears in the
|
||||
text corresponding to the node : >
|
||||
text corresponding to the node: >
|
||||
((identifier) @foo (#contains? @foo "foo"))
|
||||
((identifier) @foo-bar (#contains @foo-bar "foo" "bar"))
|
||||
<
|
||||
`any-of?` *ts-predicate-any-of?*
|
||||
Will check if the text is the same as any of the following.
|
||||
Will check if the text is the same as any of the following
|
||||
arguments: >
|
||||
((identifier) @foo (#any-of? @foo "foo" "bar"))
|
||||
<
|
||||
This is the recommended way to check if the node matches one
|
||||
of many keywords for example, as it has been optimized for
|
||||
this.
|
||||
arguments : >
|
||||
((identifier) @foo (#any-of? @foo "foo" "bar"))
|
||||
<
|
||||
*lua-treesitter-not-predicate*
|
||||
Each predicate has a `not-` prefixed predicate that is just the negation of
|
||||
|
||||
@@ -25,7 +25,7 @@ local keymap = {}
|
||||
--- vim.keymap.set('n', 'asdf', require('jkl').my_fun)
|
||||
--- </pre>
|
||||
---
|
||||
--- the require('jkl') gets evaluated during this call in order to access the function. If you want to
|
||||
--- the `require('jkl')` gets evaluated during this call in order to access the function. If you want to
|
||||
--- avoid this cost at startup you can wrap it in a function, for example:
|
||||
--- <pre>
|
||||
--- vim.keymap.set('n', 'asdf', function() return require('jkl').my_fun() end)
|
||||
|
||||
Reference in New Issue
Block a user