On Sun, Nov 10, 2019 at 12:35 AM Yee Cheng Chin <ychin.mac...@gmail.com> wrote:
>
> MacVim maintainer here. I think what you are looking for is similar to how 
> Vim running in a terminal has two tiers of selection / copy-paste: Vim's own 
> visual mode selection and yanking, versus terminal's (or tmux) own selection 
> and copy-paste mechanism. For example, in most terminals you can hold down 
> shift key and select using mouse to use the terminal's own selection scheme 
> rather than Vim's (even with mouse=a). In fact, Vim's default interactions 
> with the hosting terminal's copy-and-paste has been a source of contention 
> and why Vim just changed defaults from mouse=a to mouse=nvi.
>
> Vim GUIs *kind of* have a concept of the same "system/terminal copy-paste" 
> outside of visual mose / yanking that you want, but it's a little half-baked. 
> Look up ":h modeless-selection" to read more. If you do "set mouse=" and then 
> select texts in the GUI you are using modeless selection, which kind of 
> simulates an external text selection. Annoyingly, you have to be in command 
> line mode in order to copy texts (using CTRL-Y), so you have to type ":" to 
> enter command-line mode first before you can copy the text. (Again, read the 
> docs which provides more details)
>
> For the MacVim-specific part of not being able to unmap Cmd-C, that's because 
> it's registered in the system for the Edit -> Copy menu item, so macOS will 
> hijack it first. You can either remap the hotkey to something else (see ":h 
> macmenu") or just remove the menu item (":aunmenu Edit.Copy").
>
> So the tldr is, do the following, and you will be able to use Cmd-C to copy 
> texts when you have "set mouse=":
>
> aunmenu Edit.Copy
>
> nnoremap <D-c> :<C-Y><Esc>
>
>
> Hope that helps!


Thank you very much for this information! It was very helpful. I tried
to get it to work from insert mode with "inoremap <D-c>
<C-o>:<C-Y><Esc>" but no luck, so I've settled on the "autocopy"
mechanism. So I now have

set mouse=
set guioptions+=A

and I'll try it for a while to see if it's "good enough".

Thanks again for your help, and also for your work on MacVIm!

-- 
-- 
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/CAK-YbyCS2ipM_h%2BR03VWPpu%3D1kdoWSmfdgk%2BQ-V3xh%2BN4Nyoxg%40mail.gmail.com.

Reply via email to