2014-07-10 21:05:51 -07:00
|
|
|
|
" Vim support file to help with paste mappings and menus
|
2023-08-13 05:25:10 -07:00
|
|
|
|
" Maintainer: The Vim Project <https://github.com/vim/vim>
|
|
|
|
|
" Last Change: 2023 Aug 10
|
|
|
|
|
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
|
|
" Define the string to use for items that are present both in Edit, Popup and
|
2024-10-12 02:23:31 -07:00
|
|
|
|
" Toolbar menu. Also used in mswin.vim.
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
2019-07-28 18:16:37 -07:00
|
|
|
|
let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
|
|
|
|
|
let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
|
|
|
|
|
let paste#paste_cmd['i'] = "\<c-\>\<c-o>\"+gP"
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
2019-07-28 18:16:37 -07:00
|
|
|
|
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<ESC> moving the cursor left
|
|
|
|
|
normal! l
|
|
|
|
|
endif
|
|
|
|
|
let &ve = ove
|
|
|
|
|
endfunc
|