vim

Fork of vim, an acceptable text editor
git clone git://git.laack.co/vim.git
Log | Files | Refs | README | LICENSE

paste.vim (738B)


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