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:
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?
M-w
orS-<delete>
orS-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 upC-x
during Isearch then this will do that:(define-key isearch-mode-map (kbd "C-x") nil)
. That makes your normal binding ofC-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).C-SPC
to mark. In that case, what I suggested should do what you want:(define-key isearch-mode-map (kbd "C-x") nil)
.