Last active
August 29, 2015 14:05
-
-
Save bigs/67bcaec0d6b7f20f44fe to your computer and use it in GitHub Desktop.
replace instances of the word at the cursor (or current selection) with a new word
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun cole-foo-balls (beg end r) | |
(interactive "r\nsReplace sel. with: ") | |
(let ((s (if (use-region-p) | |
(buffer-substring-no-properties beg end) | |
(word-at-point)))) | |
(progn | |
(goto-char 0) | |
(replace-regexp s r)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment