2

In gVim (not terminal Vim), I want to be able to paste from <Shift>-Insert (a.k.a. C-V) into the text input field of a search. I.e. when I press "/", and go into search mode, I want to be able to paste there using <Shift>-Insert. I have these lines in my ~/.vimrc, which does work in terminal Vim, but pasting into the search field doesn't work in gVim:

" map X11 cut/copy/paste to vim
imap <C-V> <C-O>:set paste<CR><C-R><C-R>+<C-O>:set nopaste<CR>
vmap <C-V> "_di<C-V><ESC>
vmap <C-C> "+ygv
vmap <C-X> "+d

if has("gui_running")
    map  <silent>  <S-Insert>  "+p
    imap <silent>  <S-Insert>  <Esc>"+pa
endif

Also, my gVim/Vim binary was compiled with "+clipboard".

0

1 Answer 1

3

Perhaps you are looking for cmap? For example:

cmap <S-Insert> <C-R>+

Incidentally, you can use the <C-R>+ for your imap as well, so you don't have to leave insert mode then enter it again:

imap <S-Insert> <C-R>+

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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