annotate runtime/autoload/paste.vim @ 26435:8860c02d96a8

Added tag v8.2.3748 for changeset f612c41cfd94656dd920b7a731010f3a22652fd6
author Bram Moolenaar <Bram@vim.org>
date Sun, 05 Dec 2021 20:15:04 +0100
parents fe57e4f0eac1
children 4027cefc2aab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
718
7b21554be7a1 updated for version 7.0219
vimboss
parents:
diff changeset
1 " Vim support file to help with paste mappings and menus
7b21554be7a1 updated for version 7.0219
vimboss
parents:
diff changeset
2 " Maintainer: Bram Moolenaar <Bram@vim.org>
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
3 " Last Change: 2019 Jan 27
718
7b21554be7a1 updated for version 7.0219
vimboss
parents:
diff changeset
4
7b21554be7a1 updated for version 7.0219
vimboss
parents:
diff changeset
5 " Define the string to use for items that are present both in Edit, Popup and
7b21554be7a1 updated for version 7.0219
vimboss
parents:
diff changeset
6 " Toolbar menu. Also used in mswin.vim and macmap.vim.
7b21554be7a1 updated for version 7.0219
vimboss
parents:
diff changeset
7
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
8 let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
9 let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
10 let paste#paste_cmd['i'] = "\<c-\>\<c-o>\"+gP"
718
7b21554be7a1 updated for version 7.0219
vimboss
parents:
diff changeset
11
15729
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
12 func! paste#Paste()
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
13 let ove = &ve
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
14 set ve=all
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
15 normal! `^
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
16 if @+ != ''
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
17 normal! "+gP
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
18 endif
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
19 let c = col(".")
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
20 normal! i
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
21 if col(".") < c " compensate for i<ESC> moving the cursor left
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
22 normal! l
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
23 endif
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
24 let &ve = ove
fe57e4f0eac1 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 12499
diff changeset
25 endfunc