Showing posts with label emacs. Show all posts
Showing posts with label emacs. Show all posts

Friday, March 12, 2010

How to duplicate lines/regions in Emacs

So, I read a blog post just now on line/region duplication over here and thought I'd give it a try as well.

Here's what I came up with:


(defun duplicate-line-or-region (arg)
"Duplicates the current region (transient) ARG times, but at
least twice. If none is active, duplicate the current line
instead."
(interactive "p")
(let ((times (if (> arg 1) arg 2)))
(save-excursion
(if (use-region-p)
(kill-region (mark) (point))
(kill-region (point-at-bol) (point-at-bol 2)))
(dotimes (i times)
(yank)))))

Friday, April 6, 2007

Emacs Theme


I wasted today, tweaking David O'Toole's color-theme-cl-frame.el to be more clowney ("colorful"). I will not upload the tweaked theme ever. Ha ha ha.

[update: fugly color-theme-brx.el]