Is there an emacs function to convert a camel-cased word to underscore? Something, like:
longVariableName
M-x
to-underscore
If you want to get complete code using s.el:
(defun to-snake-case (start end)
"Change selected text to snake case format"
(interactive "r")
(if (use-region-p)
(let ((camel-case-str (buffer-substring start end)))
(delete-region start end)
(insert (s-snake-case camel-case-str)))
(message "No region selected")))