Need help remapping keys for copy/paste in EMACS
Once upon a time I had DOS and a great editor called Brief, and I was able to write all sorts of nifty macros.
Ok, today, I'm trying to do some coding under linux, and I've got a few hundred lines of text menu structures that I need to convert to an xml menu structure. First problem is my copy and paste keys are a nightmare. They used and odd key combination for each, so I keep screwing it up. I found a place where it says it will change it to normal CUA standard, Ctrl-C and CTRL-V but it doesn't work. Does anyone know how to get this to work? Thanks much :) |
I know Emacs has a Brief emulation mode (no idea how good it is, I never used Brief). To enable M-x brief-mode RET (meaning hit Alt+X, then type brief-mode then hit <enter>).
M-x cua-mode RET should bind Ctrl+C to copy but only while there is an active region (aka selection). Otherwise it retains the normal Emacs meaning. Also, note that if you run Emacs in a terminal, some keybindings can't be recognized, e.g. the terminal sends the same code for Ctrl+M as <enter>, so there is no way to distinguish between them in terminal mode. |
Hmmmm,
Thanks much for the quick response. I reprogrammed most of the Brief keyboard, so I am not really wanting their layout... But I will certainly try it to find out. I did find a place to change the copy/paste, but it didn't have any effect, and the keys still don't work, so I am forced to use the mouse. Is there a file of key mappings that you can just change like there was with Brief? Thanks again... |
I tried brief-mode, but its lost other keys that I need and I don't know how to see, change or create the key maps.
How can I get brief-mode turned off, please? |
Quote:
Quote:
Code:
(define-key global-map (kbd "C-v") 'yank) ; yank is what Emacs calls paste But there are a lot of important keybindings on C-x, and C-c so it's not really a good idea to override those (eg save is on C-x C-s). The builtin cua-mode allows the familiar Ctrl+Z,X,C,V while keeping the normal Emacs bindings for other times. Quote:
Code:
M-: (brief-mode -1) RET |
Ok, thanks much.
I got it into CUA mode and the copy/paste keys aren't right up on the menus but they work correctly now. I couldn't get the record and playback to work though because I can't figure out how to search, then start marking on the next character, then search for the end marker, back off 1 character, and copy from mark to mark, then switch buffers and paste. In Brief I think they called it "drop anchor"... Oh well. I can probably do it by hand in 6 or 8 hours. It would have been 5 min in Brief. |
And :) thanks :) for at least getting me to where I can copy/paste. The other editors I tried didn't have multiple windows and buffers, so were quite painful to use trying to edit 3 files at once like this for hundreds of lines.
|
Quote:
Quote:
Code:
C-s begin RET Quote:
|
Yes, I'm sure you are right there. It takes forever to do things when you don't know what you are doing and working in unfamiliar tools, but eventually you can get good at them if you are able to get yourself to keep trying.
I definitely haven't seen anything else better in the linux world, as far as being customizable, but its just not good trying to learn how to drain swamps when you are up to your elbows in alligators. Thanks for the help. I wish I could have found that, but I'd never have guessed to be looking for "yank". |
I did find the key map under "Describe". I should be ok with it once I get used to it. It actually looks like Brief was patterned after it. I think I read that someplace once upon a time.
|
Quote:
[1]: see also Editor Learning Curves :) (vi is a precursor to vim) |
This is sad, but I was sitting here thinking of firing up one of my old pre-windows computers and copying Brief to floppy with all my key mapping and such, and seeing if it would work under wine.
But the more I think about it, it would have problems with things like long filenames, if I recall correctly, so maybe its time to learn something new... |
All times are GMT -5. The time now is 04:17 PM. |