0
votes

I often do the following things:

  1. Copy text outside emacs
  2. Switch back to emacs, delete some text
  3. Paste

The problem is that I get back the deleted text since it overwrites the clipboard. To solve this problem, I added the following code in ~/.spacemacs

(defun dotspacemacs/user-config ()
  (setq x-select-enable-clipboard nil)
  (define-key evil-visual-state-map (kbd "s-c") (kbd "\"+y"))
  (define-key evil-insert-state-map  (kbd "s-v") (kbd "^R+"))
  (define-key evil-ex-completion-map (kbd "s-v") (kbd "^R+"))
  (define-key evil-ex-search-keymap  (kbd "s-v") (kbd "^R+")))

Now the problem has gone, but I encountered a new problem because of those lines: I cannot paste text from the clipboard when pressing C-s RET to search for words. When I press Cmd + V(I use macOS) after pressing C-s RET, I got text copied from Emacs instead of from the clipboard. How to solve that?

1

1 Answers

0
votes

I figured it out. Just use q / to search for texts. I can paste in it.