718
|
1 " Vim support file to help with paste mappings and menus
|
|
2 " Maintainer: Bram Moolenaar <Bram@vim.org>
|
15729
|
3 " Last Change: 2019 Jan 27
|
718
|
4
|
|
5 " Define the string to use for items that are present both in Edit, Popup and
|
|
6 " Toolbar menu. Also used in mswin.vim and macmap.vim.
|
|
7
|
15729
|
8 let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
|
|
9 let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
|
|
10 let paste#paste_cmd['i'] = "\<c-\>\<c-o>\"+gP"
|
718
|
11
|
15729
|
12 func! paste#Paste()
|
|
13 let ove = &ve
|
|
14 set ve=all
|
|
15 normal! `^
|
|
16 if @+ != ''
|
|
17 normal! "+gP
|
|
18 endif
|
|
19 let c = col(".")
|
|
20 normal! i
|
|
21 if col(".") < c " compensate for i<ESC> moving the cursor left
|
|
22 normal! l
|
|
23 endif
|
|
24 let &ve = ove
|
|
25 endfunc
|