Can not paste with Shift-Insert with gvim

1,102 views
Skip to first unread message

Diep Pham Van

unread,
Dec 31, 2013, 1:55:50 AM12/31/13
to vim...@googlegroups.com
I'm having unexpected result when press Shift-Insert to paste in gvim.
Instead of paste, gvim inserts '<S-Insert>', vim in a terminal work fine.

I'm using vim 7.4, this is my compile option:
http://pastebin.com/BJbiuiTL

I've already try with '-u NONE'. If I remember correctly, the
Shift-Insert paste used to work in the past.
So, any one has this problem? And how to fix it?

--
PHAM Van Diep

Tony Mechelynck

unread,
Dec 31, 2013, 2:44:11 AM12/31/13
to vim...@googlegroups.com
Your mailer's User-Agent line (Icedove 17.0.10 for linux x86_64) seems
to imply that, like me, you're on Linux; and indeed, when I hit
Shift-Insert in gvim (Huge GTK2/GNOME2 version) in Insert mode, it
inserts <S-Insert>. In Normal mode I get a beep (which I have customized
to a visual beep).

The help about this key seems to indicate that it is specific to MS-DOS
and Windows versions of Vim. You can get it back, though, with the
following mappings (untested, and this assumes Vim 7.0 or later):

noremap! <S-Insert> <C-R>+
nnoremap <S-Insert> "+gP
snoremap <S-Insert> <Esc>gvc<C-R>+
xnoremap <S-Insert> c<C-R>+<Esc>

These mappings intentionally leave you in Normal mode after using
Shift-Insert in Visual but in Insert mode after using it in Select mode.
If I didn't goof, they all leave the cursor after the inserted text.
There could be an off-by-one error in the xnoremap (Visual but not
Select) mapping. Append an l or a <Right> if it upsets you, but this
might produce an unwanted advance to the next line if you're in
blockwise- or characterwise-visual at the end of a line.

Instead of these mappings, you can of course just insert register +
(which is the clipboard) in the normal way, either with the keyboard
(using key sequences similar to the {rhs}es above) or with the "Edit →
Paste" menu.

I suppose that the fact that it still works in a terminal means that
your terminal is handling it.


Best regards,
Tony.
--
Put another password in,
Bomb it out, then try again.
Try to get past logging in,
We're hacking, hacking, hacking.

Try his first wife's maiden name,
This is more than just a game.
It's real fun, but just the same,
It's hacking, hacking, hacking.
-- To the tune of "Music, Music, Music?"

Diep Pham Van

unread,
Dec 31, 2013, 8:53:47 AM12/31/13
to vim...@googlegroups.com
On 12/31/2013 02:44 PM, Tony Mechelynck wrote:
> Instead of these mappings, you can of course just insert register +
> (which is the clipboard) in the normal way, either with the keyboard
> (using key sequences similar to the {rhs}es above) or with the "Edit →
> Paste" menu.
Maybe it's about time to press <C-r>+ more. :)

> I suppose that the fact that it still works in a terminal means that
> your terminal is handling it.
You're right.

--
PHAM Van Diep
Reply all
Reply to author
Forward
0 new messages