Monday, December 27, 2021

Re: GVIM replace from clipboard woes!

source $VIMRUNTIME/mswin.vim
" Last change: 2017 Oct 28

if has("clipboard")
    " CTRL-X and SHIFT-Del are Cut
    vnoremap <C-X> "+x
    vnoremap <S-Del> "+x

    " CTRL-C and CTRL-Insert are Copy
    vnoremap <C-C> "+y
    vnoremap <C-Insert> "+y

    " CTRL-V and SHIFT-Insert are Paste
    map <C-V> "+gP
    map <S-Insert> "+gP

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


NOTE: I created a 2nd post, when this one didn't appear for several hours. In that post, I remembered to describe the undesired behavior:

On that host, Ctrl-v pastes the entire Visual Mode selection - NOT the originally copied string!

Please, advise. Thank you.

~ Mike

On Mon, Dec 27, 2021 at 6:29 AM Bram Moolenaar <Bram@moolenaar.net> wrote:

Mike Schleif wrote:

> I use VIM on various *NIX platforms.
>
> I use GVIM on various MS Windows hosts.
>
> I often do this:
> 1. Copy a string to the clipboard
> 2. Visual mode select a string
> 3. :s/<type a substring to be replaced>/<Ctrl-v the clipboard string>/g
> 4. Enter - replace all substrings
>
> This works delightfully everywhere - EXCEPT one Windows host!
>
> I'm sure that I've got something in that host's VIMRC; but, what is it?
>
> This has been plaguing me for months ...
>
> Please, advise. Thank you.

Did you check the value of the 'clipboard' option?

--
An actual excerpt from a classified section of a city newspaper:
"Illiterate?  Write today for free help!"

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CACNUArDxd3YYQBFuW3EBU9-30FR8%2BaD3eDH_EFu4UthNfAF3wg%40mail.gmail.com.

No comments: