Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac x11 support #13

Closed
wants to merge 3 commits into from
Closed

Mac x11 support #13

wants to merge 3 commits into from

Conversation

krader1961
Copy link

I've been using this change on my Mac and Linux systems. I've verified that it does not affect the behavior of MacVim (i.e., the native, non-X11, version).

setting. This includes changes to comparisons which are insensitive to the
ignorecase setting but it's important to be consistent to avoid ambiguity.
This fixes #3 by distinguishing
between "y" and "Y" in visual mode.
Create a function that determines whether or not the clipboard mappings are
in effect. This includes the original "!has('clipboard')" test. It adds a
test for Vim on Mac OS X built with X11/GTK2 support running in a terminal.
It also adds a global var the user can set to force all key mappings. This
is similar to change proposed by ~tyru a year ago but I chose a different
name for the variable.
@kana
Copy link
Owner

kana commented May 17, 2014

There are two clipboards; Mac OS X's one and X11's one. Some users want to use the former, while other users want to user the latter. We can't say which one is better. Because it depends on users' tastes.

You patch seems to be welcomed for users who like the former. But it is not acceptable for users who want the latter because it's not possible to use the latter. If there were a variable to control whether to define key mappings for clipboard, all users can choose their preferred ones.

So that I don't want to accept this patch. If you want to access Mac OS X's clipboard from Vim built with X11/GTK2 support, you should configure fakeclip behaves so via the variable, shouldn't you?

@krader1961
Copy link
Author

For what it's worth I'm a gray beard who has written programs in the C language using the X Intrinsics (Xt) and Motif libraries (back when dinosaurs roamed the earth). So I'm well aware of the mess that is the X Window System clipboard model.

The problem is that the X11/GTK2 version of Vim on Mac OS X behaves differently with respect to the X11 clipboards depending on whether it is invoked in GUI (gvim) or non-GUI (vim) mode. If you run vim in a terminal and type "_yy no error occurs but a subsequent "_p reports

E353: Nothing in register *

If you replace * with + you get the same behavior and the yanked text is not mirrored to the OS X clipboard. Those operations do work when the same binary is invoked as gvim (i.e., GUI mode). People haven't complained about this because I suspect almost everyone uses the MacVim version that interacts directly with the OS X clipboard.

This patch was intended to make things "just work" for the few people who use the X11/GTK2 version of Vim. Having said that you're correct that the newly introduced var to force the mapping can be used by anyone who would benefit from my patch. Would you accept a patch to the documentation showing how someone in my situation can achieve the desired behavior?

@kana
Copy link
Owner

kana commented May 18, 2014

Sure. I'll update the document later. Thank you for the detailed example.

@krader1961
Copy link
Author

Okay. For the record this is what I've place in my ~/.vimrc and recommend for others:

" If this is Vim on Mac OS X compiled with GTK2 support and we're in
" non-gui mode then Vim <-> X11 <-> Clipboard shuttling doesn't work. So
" enable fakeclip support.
if has('macunix') && has('gui_gtk2') && !has('gui_running')
let g:fakeclip_provide_clipboard_key_mappings = 1
endif

@krader1961 krader1961 closed this May 18, 2014
kana added a commit that referenced this pull request May 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants