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

Visual State streams highlighted text into clipboard #1504

Closed
seanstrom opened this issue May 6, 2015 · 12 comments
Closed

Visual State streams highlighted text into clipboard #1504

seanstrom opened this issue May 6, 2015 · 12 comments

Comments

@seanstrom
Copy link

Hey so I have an issue where Spacemacs will stream, or consistently copy, the highlighted text into
my system clipboard. I'm using the official Emacs distribution for Mac OSX (not the port) and should be using the latest Spacemacs. I think this should be something configurable but I can't find the setting looking for some help please. :)

@syl20bnr
Copy link
Owner

syl20bnr commented May 7, 2015

Is this in the terminal or GUI ?

@tuhdo
Copy link
Contributor

tuhdo commented May 7, 2015

You can prevent Emacs from inserting system clipboard with x-select-enable-clipboard by setting it to nil. In the old days before Emacs 24, Emacs does not share its text with system clipboard and people found that annoying as it is the default behaviour in every application out there. See Using the Clipboard. When I was using Emacs 23, I was trying hard to get Emacs to share with system clipboard and thankfully it is enabled by default in Emacs 24 onward.

@seanstrom
Copy link
Author

This is in the GUI.
If im using x-select-enable-clipboard, anything I highlight with the cursor in Visual Mode will be copied to the clipboard. I just want the Visual Mode to highlight and then Evil Yank to copy

@syl20bnr
Copy link
Owner

syl20bnr commented May 8, 2015

Ok but x-select-enable-clipboard is not what you want then, it clearly put the selection in the clipboard but what you want is the opposite of this. So leave it to nil and when you want to yank into the clipboard use "*y.

@seanstrom
Copy link
Author

That sounds good to me! Thanks for the help guys!

@andrewsanchez
Copy link

Is there a way to set x-select-enable-clipboard to nil and still be able to use just y to yank into the clipboard? In other words, how can I bind evil-use-register based function "*y to y.

@jneen
Copy link

jneen commented Oct 14, 2015

Same question as @andrewsanchez. The use case here for me is this: I've copied some text and I want to replace some text with my copied text. I highlight the text I want to replace and paste - ...except the mere act of highlighting has blown away my clipboard.

@justin808
Copy link

I'd like to do the same as @andrewsanchez and @jneen, and also enable the regular clipboard to paste to Emacs if x-select-enable-clipboard is nil.

@justin808
Copy link

Solution:

(fset 'evil-visual-update-x-selection 'ignore)

@StreakyCobra
Copy link
Contributor

I can't reproduce the original issue (which is pretty old), the original author has said being satisfied by the solution and the ending discussion having also been answered, I'm closing this issue. In any case, feel free to open a new issue in case of troubles ☺️

@justin808
Copy link

@StreakyCobra Is my suggested change no longer necessary? I'm using "master".

@StreakyCobra
Copy link
Contributor

@justin808 I've done some searches, and it seems what you have is a normal behaviour, not a bug. But it should probably be documented in the FAQ, in How do I disable visual selection to override the system clipboard.

So reopening it and labelling as documentation and beginner friendly ☺️

@StreakyCobra StreakyCobra reopened this Nov 11, 2015
StreakyCobra added a commit that referenced this issue Nov 17, 2015
Close #1206
Close #1269
Close #1504
Close #1742
Correct #3839
d12frosted pushed a commit to d12frosted/spacemacs that referenced this issue Nov 23, 2015
jramnani added a commit to jramnani/dotfiles that referenced this issue Jan 15, 2021
The default settings on macOS create a situation where just highlighting
text in visual mode sends it to the clipboard. Which fills it with
partial junk and stuff I don't want.

Now to add text to the clipboard I need to highlight in in visual mode
and explicitly put it in the clipboard via Cmd+C.

Source: syl20bnr/spacemacs#1504
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants