mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
Added a smarter ruby-mode class snippet
This commit is contained in:
parent
36184e0bc7
commit
59d35739fa
@ -1,5 +1,12 @@
|
||||
#name : class ... end
|
||||
#contributor : hitesh <hitesh.jasani@gmail.com>
|
||||
# --
|
||||
class ${Name}
|
||||
class ${1:$
|
||||
(let ((fn (capitalize (file-name-nondirectory
|
||||
(file-name-sans-extension
|
||||
(buffer-file-name))))))
|
||||
(cond
|
||||
((string-match "_" fn) (replace-match "" nil nil fn))
|
||||
(t fn)))}
|
||||
$0
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user