mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Merge pull request #282 from jimeh/add-ruby-module-snippet
Enhancement, exceptional: Add `mod` snippet to ruby-mode for `module` definitions
This commit is contained in:
commit
f82350a75d
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