1

I want to cut/copy some code with this method:

  • setting a mark with C-SPC,
  • searching with C-s,
  • then cutting/copying the selection.

Check the following image:

enter image description here

I can copy selected code with M-w or cut (kill) it with S-Del.

But since I am using CUA-mode, I would prefer to use its keybindings.
Copying with C-c works but cutting with C-x fails.
Is it possible to tweak C-x to make it work in this situation?

nephewtom
  • 2,219
  • 17
  • 29
  • I don't see how even `M-w` or `S-` or `S-DEL` works. The current search hit is not in any way *selected* (as in the region). But if all you want to do is free up `C-x` during Isearch then this will do that: `(define-key isearch-mode-map (kbd "C-x") nil)`. That makes your normal binding of `C-x` usable. But it will not cut the highlighted search hit. It will cut the region from the mark to point (end of search hit, if forward). – Drew May 30 '16 at 02:37
  • 1
    Oh, I see that you mentioned `C-SPC` to mark. In that case, what I suggested should do what you want: **`(define-key isearch-mode-map (kbd "C-x") nil)`**. – Drew May 30 '16 at 02:40

1 Answers1

1

It seems @Drew already answered in the comments of the question.

This makes it:

(define-key isearch-mode-map (kbd "C-x") nil)

He deserves the merit. I just copy the solution here for better reading ;-)

nephewtom
  • 2,219
  • 17
  • 29