A simple Emacs question on copying

How do you, very simply, copy a line in emacs?
I usually do ctrl k (repeating the key for multiple lines), then ctrl y back in, and then paste whereever else I want.
I want wondering if there is a simpler method to copying the line.
I can set a mark, and then do alt w, but its two commands --- is there a one
command version of ctrl k for copying a line without deleting a line?
You have a few options here: http://emacswiki.org/emacs/CopyingWholeLines

You could also just write a custom command.
Last edited on
Thanks!!!!!!!!!!!!!
One more query: how do write a custom command so that when I press F1, it inputs the $ symbol?
I mean I have the $ sign on the keyboard, but I have to press shift. It would simplify my life a lot if I can press one key and emacs views it as $ sign; and similarly for {, } etc.
Weird, the version of emacs I run allows clicking and highlighting and ctrl c / ctrl v.
Try adding this to your .emacs file:
(global-set-key [f1] "$")

Change the key in brackets and the character in quotes to whatever you want.
That worked, thanks ascii!!!!!!!!!!!
A couple more queries on customization:

How do I map certain numpad keys to things I want?
Eg mapping the numpad key 7 to (

How do I map say ctrl-8 to left bracket, that is ( ?
Topic archived. No new replies allowed.