Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

What would be the commands to be able to do CTRL + V on gVim?

In OS X I can copy text into vim, but on Windows I'm not getting.

share|improve this question

migrated from Dec 5 '11 at 11:53

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

I would recommend to one of the following instead of setting up custom shortcuts:

  1. Paste from register:


  2. Paste using middle mouse button

  3. Paste using context menu


According to this answer you might need to have the clipboard set to unnamed to get register pasting to work.

set clipboard=unnamed

share|improve this answer
Only "+ p does not work in mac or win... – Anderson Juhasc Dec 5 '11 at 15:44
@AndersonJuhasc according to this answer you might need to set clipboard=unnamed – tidbeck Dec 5 '11 at 16:01
thanks tidbeck =) – Anderson Juhasc Dec 5 '11 at 16:11

From the vim documentation:


To use the standard MS-Windows way of CTRL-X, CTRL-C and CTRL-V, use the $VIMRUNTIME/mswin.vim script. You could add this line to your _vimrc file: source $VIMRUNTIME/mswin.vim

share|improve this answer

While you can set up key bindings as Otiel suggests, I think it might be more useful to understand how copy and paste works in Vim, and learn what those commands actually mean.

The cut, copy and paste commands in Vim (d, y and p) work with so-called registers which hold the text last cut or copied. By default, they use the unnamed register "", while the system clipboard is the "+ register.

You can prefix commands with a register to that one instead. So, to copy from Vim to Windows, use "+y, and to paste from Windows, use "+p.

You also have 26 registers named "a to "z which you can use for anything you want. This can be very useful when doing complex editing operations.

There are more special registers as well, for more info, see :help registers.

share|improve this answer
Using '"+ y' in OSX? – Anderson Juhasc Dec 5 '11 at 12:36

Add the following in your vimrc file (should be located under C:\Program Files\Vim\_vimrc):

" CTRL-X = cut
vnoremap <C-X> "+x
" CTRL-C = copy
vnoremap <C-C> "+y
" CTRL-V = paste
map <C-V> "+gP
cmap <C-V> <C-R>+
exe 'inoremap <script> <C-V>' paste#paste_cmd['i']
exe 'vnoremap <script> <C-V>' paste#paste_cmd['v']
imap <S-Insert> <C-V>
vmap <S-Insert> <C-V>

Or use the p command in vim to paste the content of the clipboard.

share|improve this answer
... that is sooo wrong ... – Rook Dec 5 '11 at 0:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .