aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/vim.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-11-06 01:49:33 -0800
committerGitHub <noreply@github.com>2019-11-06 01:49:33 -0800
commitf79369d4205fe2e812a5b8f3f96bf97a679690a4 (patch)
treeb19d3ec333ccf2b979bae09254c93a1a8e0d2761 /src/nvim/lua/vim.lua
parent3e21d498362f8cfff7ee467be6402fb00a53eeb5 (diff)
parent9ef16a1628722958b6e14fe9274006e50ed6682d (diff)
downloadrneovim-f79369d4205fe2e812a5b8f3f96bf97a679690a4.tar.gz
rneovim-f79369d4205fe2e812a5b8f3f96bf97a679690a4.tar.bz2
rneovim-f79369d4205fe2e812a5b8f3f96bf97a679690a4.zip
Merge #11277 'doc [ci skip]'
Diffstat (limited to 'src/nvim/lua/vim.lua')
-rw-r--r--src/nvim/lua/vim.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nvim/lua/vim.lua b/src/nvim/lua/vim.lua
index 5514819a02..adb90084db 100644
--- a/src/nvim/lua/vim.lua
+++ b/src/nvim/lua/vim.lua
@@ -165,6 +165,20 @@ end
--- Paste handler, invoked by |nvim_paste()| when a conforming UI
--- (such as the |TUI|) pastes text into the editor.
---
+--- Example: To remove ANSI color codes when pasting:
+--- <pre>
+--- vim.paste = (function()
+--- local overridden = vim.paste
+--- return function(lines, phase)
+--- for i,line in ipairs(lines) do
+--- -- Scrub ANSI color codes from paste input.
+--- lines[i] = line:gsub('\27%[[0-9;mK]+', '')
+--- end
+--- overridden(lines, phase)
+--- end
+--- end)()
+--- </pre>
+---
--@see |paste|
---
--@param lines |readfile()|-style list of lines to paste. |channel-lines|