Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using gvim for text editing.

Some shortcuts are listed as

Cut +y
Paste "+gP

However those precise key combinations do not work so I suppose that + and g might be abbreviations for other shortcuts. How can I figure this one out?

share|improve this question

It's "+y, not +y

The "+ prefixes tell vim to use the X11 clipboard instead of vim's internal clipboard. You only need them if you want to exchange text with other programs.

Usually you can just use y to yank the marked text (if you are in visual mode) or append some move commands to yank a text range, like y2w to yank the next two words. Then use p or gP to paste the yanked text before (p) or after (gP) the cursor. gP moves the cursor behind the new text while g sets it at the start of the new text.

As gvim, like any other vi derivative, isn't intuitive to use you really should read the handbook in the Help menu.

share|improve this answer
My question probably wasn't clear enough. How can I use the X11 clipboard from inside gvim? I am familiar with vim commands, but I fail to use the clipboard from window to window (or gvim instance to gvim instance if you will). – Eric Oct 26 '11 at 20:10
Use the "+ prefix (e.g. "+p) to access the X11 clipboard (used by most programs with Ctrl-C/Ctrl-V) and "* (e.g. "*p) to access the X11 primary selection (the content you can usually insert by pressing the middle mouse button). – Florian Diesch Oct 26 '11 at 20:35

By adding set clipboard=unnamedplus in your .vimrc or .gvimrc you can copy paste between instances of gvim with y to yank and p to paste

This also allows you to copy and paste between gvim and other programs

share|improve this answer

The confusion here is that you might be pressing those keyboard combinations in editing mode.

Make sure you are not in editing mode before doing exactly that. Type, one by one:





Then when you press enter it will copy what's in your clipboard.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.