mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Add mod
snippet to ruby-mode for module
definitions
This commit is contained in:
parent
5eede17563
commit
064c068c45
13
snippets/ruby-mode/definitions/mod
Normal file
13
snippets/ruby-mode/definitions/mod
Normal 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
|
Loading…
x
Reference in New Issue
Block a user