-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Ability to yank / delete and *not* overwrite clipboard #5750
Comments
According to this thread the The second problem being that selecting a text to delete it yanks it to the system-clipboard. To avoid this you have to use With this you'll have to separate clipboards, one for emacs, one for the system. But as now the two clipboards are separated, emacs command will use the emacs one, meaning that to get the content of your system clipboard you'll have to explicitly specify the system one:
So with the split activated, you'll need to use Note: It is possible to achieve what you want without this tweak by only selecting the text in Emacs (without deleting it):
|
Changed title to be more specific @StreakyCobra I saw that link and I understand the 2nd method you mentioned. Also there's Can't seem to get your first method to work, when I do If I could get your first method to work I think that would be great. Leaving all the vim commands to it's own emacs clipboard. And having the default system clipboard shortcuts be just for systems. And if your method worked then I could just bind ⌘V to it 😀 |
Can you paste here the result of |
System Info
(auto-completion emacs-lisp git markdown clojure ocaml javascript html python react version-control) |
Can you try |
That pastes, it does the same as So even if |
I can't help further, so trying to ping an OS X guy: @d12frosted |
@StreakyCobra ok, thank you for your help so far though, much appreciated. I'll also try it on other setup / systems. (Though I'm not sure how many people will want to set this up similarly in the end, doing one of the other methods mentioned seems reasonable if there's no easy solution, or maybe there already is, just my build is messed up 😆 ). |
@hnry, try using the black hole register, it doesn't affect the kill ring. |
thanks for all the inputs i guess it's time to close this now as it's not a bug or a feature request |
In case anybody else wants this, I got it to work on my machine using
This separates the two clipboards, binds ⌘C to "yank to OS X clipboard", and binds ⌘V to "paste from OS X clipboard". |
@gelisam When I tried this.. ⌘v actually inserts the characters |
Note that the "^R" is a single character, produced by typing |
This commit adds a new option `osx-use-separate-clipboards` to the `osx` layer. When set to non nil, the layer treats the OSX pasteboard separate from the spacemacs kill-ring. Default is `nil`, which is the same behaviour as without this commit, hence not expecting any breaking changes. Fixes syl20bnr#6533 syl20bnr#5750
This commit adds a new option `osx-use-separate-clipboards` to the `osx` layer. When set to non nil, the layer treats the OSX pasteboard separate from the spacemacs kill-ring. Default is `nil`, which is the same behaviour as without this commit, hence not expecting any breaking changes. Fixes syl20bnr#6533 syl20bnr#5750
This commit adds a new option `osx-use-separate-clipboards` to the `osx` layer. When set to non nil, the layer treats the OSX pasteboard separate from the spacemacs kill-ring. Default is `nil`, which is the same behaviour as without this commit, hence not expecting any breaking changes. This commit also includes changes to the README file, in response to a previously failing test (document must have a `Features:` section). Fixes syl20bnr#6533 Fixes syl20bnr#5750
This seems to be linked from a couple of external places. Here's what you can copy directly to your config file to solve the OP:
If you're reading this and not using spacemacs (such as me), also add:
This will change super-c (cmd, win) to only copy to system clipboard with an active selection, and super-v (cmd, win) to always paste. Changing/deleting/yanking text will not clobber your default clipboard. |
Maybe this will help someone... I couldn't get the above suggestions to work well, so what I did was enable the (setq select-enable-clipboard nil) That works great, but you can no longer paste while in insert mode, so you can add these lines: (global-set-key (kbd-mac-command "v") 'spacemacs/xclipboard-paste)
(global-set-key (kbd-mac-command "c") 'spacemacs/xclipboard-copy) This works as I had hoped so far. Couldn't figure out how to do cut (cmd+x), but I don't use it much. Was thinking you could bind it to |
I can't make the above solutions work for me all the time. Then I found this package https://github.com/rolandwalker/simpleclip. It hasn't failed on me so far. |
It is not work in |
I can confirm that this doesn't work under terminal. Any solution? System Info 💻
(react ruby purescript phalcon sql
(python :variables python-backend 'lsp python-lsp-server 'pylsp python-test-runner 'pytest)
yaml fsharp remote-sync
(typescript :variables node-add-modules-path t typescript-fmt-tool 'prettier)
clojure html javascript
(unicode-fonts :variables unicode-fonts-force-multi-color-on-mac t)
(multiple-cursors :variables multiple-cursors-backend 'evil-mc)
(osx :variables osx-option-as 'none)
auto-completion better-defaults emacs-lisp prettier git helm csharp prolog markdown multiple-cursors org
(xclipboard :variables xclipboard-enable-cliphist t)
(shell :variables shell-default-height 30 shell-default-position 'bottom)
syntax-checking version-control treemacs)
|
Often I do things in this order ->
Problem is I get back the deleted text since it overwrites the clipboard.
I want to just keep the two things completely separate. vim commands/emacs will deal with only the ring buffer stuff, my clipboard is untouched. That way I can setup a explicit keybinding when I actually do want to copy over something to my clipboard like with c-c (win) or s-c (mac).
How can I do this? I tried in my
.spacemacs
file:But it's not working for me. :(
The text was updated successfully, but these errors were encountered: