Add mod snippet to ruby-mode for module definitions

This commit is contained in:
Jim Myhrberg 2012-08-11 14:37:31 +01:00 committed by João Távora
parent 5eede17563
commit 064c068c45

View File

@ -0,0 +1,13 @@
# name: module ... end
# contributor: hitesh <hitesh.jasani@gmail.com>, jimeh <contact@jimeh.me>
# key: mod
# --
module ${1:`(let ((fn (capitalize (file-name-nondirectory
(file-name-sans-extension
(or (buffer-file-name)
(buffer-name (current-buffer))))))))
(cond
((string-match "_" fn) (replace-match "" nil nil fn))
(t fn)))`}
$0
end