Skip to content

Instantly share code, notes, and snippets.

@marick
Created September 25, 2010 00:45
Show Gist options
  • Save marick/596307 to your computer and use it in GitHub Desktop.
Save marick/596307 to your computer and use it in GitHub Desktop.
(defun camelcase-region (start end)
"Changes region from snake_case to camelCase"
(interactive "r")
(save-restriction (narrow-to-region start end)
(goto-char (point-min))
(while (re-search-forward "_\\(.\\)" nil t)
(replace-match (upcase (match-string 1))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment