help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: copy-word-from-line-above


From: Marc Tfardy
Subject: Re: copy-word-from-line-above
Date: Thu, 18 Jan 2007 21:50:44 +0100
User-agent: Thunderbird 1.5 (X11/20051201)

HS wrote:
Hello!
Does anyone have a function that copies words from the line above, word
after word ?
I'd like this function so I could have something like this:

double int xxx;

Then I'd just put the cursor under that line, press <f2> (for example)
twice and would be in this state:

double int xxx;
double int

then I would continue adding the new variable.

Not exactly what you looking for, but a simple macro do a similar job:

C-a                     ;; beginning-of-line
C-p                     ;; previous-line
C-SPC                   ;; set-mark-command
C-e                     ;; end-of-line
M-w                     ;; kill-ring-save
C-a                     ;; beginning-of-line
C-n                     ;; next-line
C-y                     ;; yank


or:

(fset 'duplicate-last-line
   [?\C-a ?\C-p ?\C-  ?\C-e ?\M-w ?\C-a ?\C-n ?\C-y])

This macro duplcates whole previous line. The point is on the
end of the line. Now you can press (one or more times ) M-DEL
and continue editing.


regards

Marc



reply via email to

[Prev in Thread] Current Thread [Next in Thread]