On Wednesday, November 6, 2019 at 11:32:09 PM UTC+1, Steve Molin wrote:
>
> I would like to use double-click to select a word and command-C to copy to 
> the system cut buffer (terminology?), which works fine as long as "set 
> mouse=a"
>
> But that has the side effect of moving the insert cursor position, which I 
> disable with "set mouse="
>
> Can I have both behaviors? Ie, double-click to select a work, command-C to 
> copy selection, without moving the cursor?
>
> I've ready extensively in the FAQ and other docs and I can't figure it out.
>
> Thanks!
>

The canonical way to put stuff into the clipboard or the cut-buffer in Vim 
is to "yank" (or "delete") into either register + or register *. Under X11 
(Unix, Linux, BeOS, etc.) these two registers are different, under Windows 
they are the same, under OSX I'm not sure. Register + (the "clipboard") is 
used in all GUIs (including gvim) for Edit→Copy, Edit→Paste and Edit→Cut. 
Register * (the "selection") is pasted by the middle mouse button.

The mouse works beautifully in gvim (or, I suppose, in the macvim GUI); 
when running Vim in a terminal it depends on the terminal. If the mouse 
doesn't do what you want you can always use the keyboard: for instance, to 
yank the current word into the clipboard from Insert mode it's Ctrl-O (or 
maybe Cmd-O on OSX, I'm not sure but I don't think so) followed by "+yaw 
(Ctrl-O for "do one Normal-mode command", quote-plus for "into the 
clipboard" and yaw for "yank a word). Once you get the hang of it you'll 
find out that the mouse is ideal to move the cursor to a random point in 
the text and that the keyboard is more efficient for almost everything else.

Best regards,
Tony.

-- 
-- 
You received this message from the "vim_mac" 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_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_mac+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_mac/c8bceed2-ae21-42a7-b6ee-5a946f8fdca1%40googlegroups.com.

Reply via email to