2 ms·
...Which is actually quite simple. Here's my function for doing that that I wrote just now: (defun duplicate-line (interactive) (kill-whole-line)
by qwertyuiop924 10y ago
...Which is actually quite simple. Here's my function for doing that that I wrote just now:
(defun duplicate-line
(interactive)
(kill-whole-line)
(yank)
(yank))
Five lines, and it took me all of ten minutes to write, including looking up the names of all the functions. Of course, there's probably a better way to do this, but I don't know what it is. Now all you have to do is bind it to a key.
Or, of course, you could just record a keyboard macro to do it instead.
- _asummers 10y agoI have mine set up like this: https://gist.github.com/asummers/7784d40b1bc53ee309777274e9d10997 https://gist.github.com/asummers/7784d40b1bc53ee309777274e9d... That way I can hit M-w when I don't have a region and get the copy behavior for the whole line.
- qwertyuiop924 10y agoThat's cool. I have no idea how that works, but it's cool.