mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
docs(lsp): do not use nvim_command for Vimscript examples
The examples are relevant and applicable for both Lua and Vimscript configurations and the `vim.api.nvim_command` prefixes just add noise that doesn't contribute to the example.
This commit is contained in:
parent
5a24c2c83d
commit
d0fbbea62a
@ -991,9 +991,9 @@ document_highlight() *vim.lsp.buf.document_highlight()*
|
||||
triggered by a key mapping or by events such as `CursorHold` ,
|
||||
eg:
|
||||
>
|
||||
vim.api.nvim_command [[autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()]]
|
||||
vim.api.nvim_command [[autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()]]
|
||||
vim.api.nvim_command [[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]]
|
||||
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
||||
autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()
|
||||
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
||||
<
|
||||
|
||||
Note: Usage of |vim.lsp.buf.document_highlight()| requires the
|
||||
@ -1061,7 +1061,7 @@ formatting_sync({options}, {timeout_ms})
|
||||
|vim.lsp.buf_request_sync()|. Example:
|
||||
>
|
||||
|
||||
vim.api.nvim_command[[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]]
|
||||
autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()
|
||||
<
|
||||
|
||||
Parameters: ~
|
||||
|
@ -165,7 +165,7 @@ end
|
||||
--- saved. {timeout_ms} is passed on to |vim.lsp.buf_request_sync()|. Example:
|
||||
---
|
||||
--- <pre>
|
||||
--- vim.api.nvim_command[[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]]
|
||||
--- autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()
|
||||
--- </pre>
|
||||
---
|
||||
---@param options Table with valid `FormattingOptions` entries
|
||||
@ -447,9 +447,9 @@ end
|
||||
--- by events such as `CursorHold`, eg:
|
||||
---
|
||||
--- <pre>
|
||||
--- vim.api.nvim_command [[autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()]]
|
||||
--- vim.api.nvim_command [[autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()]]
|
||||
--- vim.api.nvim_command [[autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()]]
|
||||
--- autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
||||
--- autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()
|
||||
--- autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
||||
--- </pre>
|
||||
---
|
||||
--- Note: Usage of |vim.lsp.buf.document_highlight()| requires the following highlight groups
|
||||
|
Loading…
Reference in New Issue
Block a user