paste.vim 672 B

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