Permalink
Browse files

Updated to include clojurescript / clojure-mode support and added uni…

…qify functions for de-duping data in a buffer
  • Loading branch information...
1 parent 854aefa commit 71da6b114a91ba8e34eb8b21606a88e141278bd2 @pmn committed Jan 12, 2012
Showing with 13 additions and 0 deletions.
  1. +1 −0 init.el
  2. +12 −0 utils/uniqify.el
View
@@ -54,6 +54,7 @@
(setq-default frame-background-mode 'dark)
(require 'rainbow-delimiters)
(add-hook 'clojure-mode-hook 'rainbow-delimiters-mode)
+(add-to-list 'auto-mode-alist '("\.cljs$" . clojure-mode))
;; Go
(require 'go-mode)
View
@@ -0,0 +1,12 @@
+(defun uniquify-region-lines (beg end)
+ "Remove duplicate adjacent lines in region."
+ (interactive "*r")
+ (save-excursion
+ (goto-char beg)
+ (while (re-search-forward "^\\(.*\n\\)\\1+" end t)
+ (replace-match "\\1"))))
+
+(defun uniquify-buffer-lines ()
+ "Remove duplicate adjacent lines in the current buffer."
+ (interactive)
+ (uniquify-region-lines (point-min) (point-max)))

0 comments on commit 71da6b1

Please sign in to comment.