Skip to content

Instantly share code, notes, and snippets.

@jewel12
Created May 11, 2013 19:16
Show Gist options
  • Save jewel12/5561050 to your computer and use it in GitHub Desktop.
Save jewel12/5561050 to your computer and use it in GitHub Desktop.
カーソル手前の単語群をアンダースコアでつなげる
(defun join-words-by-underscore ()
(interactive)
(save-excursion
(save-restriction
(looking-back "[\s-\]*\\(\[a-zA-Z0-9\s-\]+\\)" nil t)
(narrow-to-region (match-beginning 1) (match-end 1))
(beginning-of-line)
(replace-string " " "_"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment