aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/vim.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-10-27 15:05:59 -0700
committerJustin M. Keyes <justinkz@gmail.com>2019-11-06 01:37:50 -0800
commit9ef16a1628722958b6e14fe9274006e50ed6682d (patch)
treeb19d3ec333ccf2b979bae09254c93a1a8e0d2761 /src/nvim/lua/vim.lua
parentc66297452c523ce599aad79aeea2f510094c93d4 (diff)
downloadrneovim-9ef16a1628722958b6e14fe9274006e50ed6682d.tar.gz
rneovim-9ef16a1628722958b6e14fe9274006e50ed6682d.tar.bz2
rneovim-9ef16a1628722958b6e14fe9274006e50ed6682d.zip
doc: vim.fn, vim.call(), vim.api [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|