aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/provider.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/provider.txt')
-rw-r--r--runtime/doc/provider.txt33
1 files changed, 33 insertions, 0 deletions
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index dc045c360a..eb6d562e18 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -219,6 +219,39 @@ function returns the clipboard as a `[lines, regtype]` list, where `lines` is
a list of lines and `regtype` is a register type conforming to |setreg()|.
==============================================================================
+Paste *provider-paste* *paste*
+
+"Paste" is a separate concept from |clipboard|: paste means "dump a bunch of
+text to the editor", whereas clipboard adds features like |quote-+| to get and
+set the OS clipboard buffer directly. When you middle-click or CTRL-SHIFT-v
+(macOS: CMD-v) to paste text into your terminal, this is "paste", not
+"clipboard": the terminal application (Nvim) just gets a stream of text, it
+does not interact with the clipboard directly.
+
+ *bracketed-paste-mode*
+Pasting in the |TUI| depends on the "bracketed paste" terminal capability,
+which allows terminal applications to distinguish between user input and
+pasted text. https://cirw.in/blog/bracketed-paste
+This works automatically if your terminal supports it.
+
+ *ui-paste*
+GUIs can opt-into Nvim's amazing paste-handling by calling |nvim_paste()|.
+
+PASTE BEHAVIOR ~
+
+Paste always inserts text after the cursor. In cmdline-mode only the first
+line is pasted, to avoid accidentally executing many commands.
+
+When pasting a huge amount of text, screen updates are throttled and the
+message area shows a "..." pulse.
+
+You can implement a custom paste handler. Example: >
+
+ vim._paste = (function(lines, phase)
+ vim.api.nvim_put(lines, 'c', true, true)
+ end)
+
+==============================================================================
X11 selection mechanism *clipboard-x11* *x11-selection*
X11 clipboard providers store text in "selections". Selections are owned by an