docs: setting g:clipboard after provider init #37705

Problem:
Users may be unaware that setting `g:clipboard` after providers are
initialized has no effect, and that `has('clipboard')` initializes
providers, as in #13062.

Solution:
Note the restriction and link to workarounds in FAQ for discoverability.

(cherry picked from commit 2a906bfad6)
This commit is contained in:
Kevin Locke
2026-02-04 19:19:58 +00:00
committed by github-actions[bot]
parent d47d317a79
commit b90b0c8d17
+5 -1
View File
@@ -199,7 +199,11 @@ registers. Nvim supports these clipboard tools, in order of priority:
*g:clipboard* *g:clipboard*
To configure a custom clipboard tool, set `g:clipboard` to a string name (from To configure a custom clipboard tool, set `g:clipboard` to a string name (from
the above |clipboard-tool| list), or dict (to explicitly specify the shell the above |clipboard-tool| list), or dict (to explicitly specify the shell
commands or |lambda| functions). commands or |lambda| functions) before clipboard providers are initialized.
Note: Clipboard providers are initialized by calling `has('clipboard')`, which
is best avoided before setting `g:clipboard`. See "G:CLIPBOARD SETTINGS ARE NOT
USED" in |faq-runtime| for workarounds.
If "cache_enabled" is |TRUE| then when a selection is copied Nvim will cache If "cache_enabled" is |TRUE| then when a selection is copied Nvim will cache
the selection until the copy command process dies. When pasting, if the copy the selection until the copy command process dies. When pasting, if the copy