reddit / emacs

CUA - remap C-c and C-x key sequences?

Under-Estimated · 2022-05-10 14:41
Beginner here, considering switching to emacs from vscode. I was reading about rebinding copy/cut/paste/undo to the standard keybindings of ctrl-c/x/v/z but this apparently interferes with Emacs's default key chords. Is there any way to rebind the key chords to a different key, say, ctrl+d or ctrl+b? In other words, a shortcut originally bound to ctrl+x <some key> will now be bound to ctrl+d <some key>. I'm just a little worried that using something like CUA mode will interfere with my ability to use advanced shortcuts that rely on ctrl+x modifier chords later on. Thanks
LemonBreezes · 2022-05-10 15:10
You can transpose C-x and C-d with `key-translation-map`, then bind cut to C-d. That'll bind cut to C-x physically on your keyboard.
takutekato · 2022-05-10 16:00
Even if you decide to use CUA mode, `C-x` and `C-c` are still available as `C-S~x` and `C-S-c` where the region is active so that's not a significant issue. IMO, mapping `C-x/c` away will give far more nuisances later on.
0lMon · 2022-05-10 16:22
Hej Hej, I was a cua user for many years, because I thought I would never get used to the Emacs keys. But it was easier then I thought. Nevertheless if you want to use CUA it is very well made. You will not lose the possibility of using the prefix C-c C-x keys in every manner. Cua-mode checks if a region is active. If not C-c/C-x act as normal prefix keys. Should a region be active you have two possibilities: 1. be very fast with your hotkeys. Lets say C-c C-r is a key combination that you want to use. If you press C-r in less then 0.3s after C-c (I think it was 0.3s, but you can change it) the C-c will act as prefix. 2. Use the shift key. Same example as above, just mark the region and press C-S-c C-r. In the years I used cua-mode I did not have a lot situations were cua got in the way. Maybe a small addition because now I realize all comments are in emacs notation without much explanation: C- stands for ctrl+ S- stand for shift+ Cua-mode is a mode built in Emacs that can be activated to have the "typical" cut, copy paste keys. Cheers!
dpoggio · 2022-05-11 04:03
I still use CUA. I use Emacs like 10 hours a day, maybe even more. I use Emacs as my Agenda, Spreadshet, Note taking app, File manager, IDE, Project management tool and more. Some (many) times, mostly at work, I’ve found my muscle memory shooting `M-w` on the browser and then trying to paste to Org, or worse, shooting `C-u C-SPC` to Word and then regretting with `C-x u`. TACL shell happens to use `C-y` to kill the shell, so you could imagine. My personal life is different, I just use Emacs as my OS basically. I think CUA could be a default. It’s harmless. Whenever you start to make Emacs your own, you will have your own set of hundreds of keybindings. Should anything interfere with something else, you will be perfectly able to choose a better keychord for yourself. I have my own minor modes to fit to my different mind frames.
LowCom · 2022-05-11 08:31
How do you use emacs as spreadsheet? What mode do you use?