From aed8ce9da277f5ecffe968b324f242c41c3b752a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 10:50:31 +0200 Subject: Adding upstream version 2:9.0.1378. Signed-off-by: Daniel Baumann --- runtime/autoload/paste.vim | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 runtime/autoload/paste.vim (limited to 'runtime/autoload/paste.vim') diff --git a/runtime/autoload/paste.vim b/runtime/autoload/paste.vim new file mode 100644 index 0000000..2d787e7 --- /dev/null +++ b/runtime/autoload/paste.vim @@ -0,0 +1,25 @@ +" Vim support file to help with paste mappings and menus +" Maintainer: Bram Moolenaar +" Last Change: 2019 Jan 27 + +" Define the string to use for items that are present both in Edit, Popup and +" Toolbar menu. Also used in mswin.vim and macmap.vim. + +let paste#paste_cmd = {'n': ":call paste#Paste()"} +let paste#paste_cmd['v'] = '"-c' . paste#paste_cmd['n'] +let paste#paste_cmd['i'] = "\\\"+gP" + +func! paste#Paste() + let ove = &ve + set ve=all + normal! `^ + if @+ != '' + normal! "+gP + endif + let c = col(".") + normal! i + if col(".") < c " compensate for i moving the cursor left + normal! l + endif + let &ve = ove +endfunc -- cgit v1.2.3