mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
docs(lsp): mention default enablement of document colors (#35153)
This commit is contained in:

committed by
GitHub

parent
c789d79966
commit
54bfd0de4f
@@ -97,6 +97,8 @@ BUFFER-LOCAL DEFAULTS
|
|||||||
- To opt out of this use |gw| instead of gq, or clear 'formatexpr' on |LspAttach|.
|
- To opt out of this use |gw| instead of gq, or clear 'formatexpr' on |LspAttach|.
|
||||||
- |K| is mapped to |vim.lsp.buf.hover()| unless |'keywordprg'| is customized or
|
- |K| is mapped to |vim.lsp.buf.hover()| unless |'keywordprg'| is customized or
|
||||||
a custom keymap for `K` exists.
|
a custom keymap for `K` exists.
|
||||||
|
- Document colors are enabled for highlighting color references in a document.
|
||||||
|
- To opt out call `vim.lsp.document_color.enable(false, args.buf)` on |LspAttach|.
|
||||||
|
|
||||||
DISABLING DEFAULTS *lsp-defaults-disable*
|
DISABLING DEFAULTS *lsp-defaults-disable*
|
||||||
You can remove GLOBAL keymaps at any time using |vim.keymap.del()| or
|
You can remove GLOBAL keymaps at any time using |vim.keymap.del()| or
|
||||||
@@ -2126,15 +2128,6 @@ enable({enable}, {bufnr}, {opts}) *vim.lsp.document_color.enable()*
|
|||||||
Enables document highlighting from the given language client in the given
|
Enables document highlighting from the given language client in the given
|
||||||
buffer.
|
buffer.
|
||||||
|
|
||||||
You can enable document highlighting when a client attaches to a buffer as
|
|
||||||
follows: >lua
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
|
||||||
callback = function(args)
|
|
||||||
vim.lsp.document_color.enable(true, args.buf)
|
|
||||||
end
|
|
||||||
})
|
|
||||||
<
|
|
||||||
|
|
||||||
To "toggle", pass the inverse of `is_enabled()`: >lua
|
To "toggle", pass the inverse of `is_enabled()`: >lua
|
||||||
vim.lsp.document_color.enable(not vim.lsp.document_color.is_enabled())
|
vim.lsp.document_color.enable(not vim.lsp.document_color.is_enabled())
|
||||||
<
|
<
|
||||||
|
@@ -286,15 +286,6 @@ end
|
|||||||
|
|
||||||
--- Enables document highlighting from the given language client in the given buffer.
|
--- Enables document highlighting from the given language client in the given buffer.
|
||||||
---
|
---
|
||||||
--- You can enable document highlighting when a client attaches to a buffer as follows:
|
|
||||||
--- ```lua
|
|
||||||
--- vim.api.nvim_create_autocmd('LspAttach', {
|
|
||||||
--- callback = function(args)
|
|
||||||
--- vim.lsp.document_color.enable(true, args.buf)
|
|
||||||
--- end
|
|
||||||
--- })
|
|
||||||
--- ```
|
|
||||||
---
|
|
||||||
--- To "toggle", pass the inverse of `is_enabled()`:
|
--- To "toggle", pass the inverse of `is_enabled()`:
|
||||||
---
|
---
|
||||||
--- ```lua
|
--- ```lua
|
||||||
|
Reference in New Issue
Block a user