1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-21 17:25:11 +01:00
vim/runtime/autoload/paste.vim

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
738 B
VimL
Raw Normal View History

2006-03-09 22:27:48 +00:00
" Vim support file to help with paste mappings and menus
" Maintainer: The Vim Project <https://github.com/vim/vim>
" Last Change: 2023 Aug 10
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
2006-03-09 22:27:48 +00:00
" 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.
2019-02-03 15:27:20 +01: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"
2006-03-09 22:27:48 +00:00
2019-02-03 15:27:20 +01: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