From 7a6bb0f05e349068b0a89514f1da33d6d7de30a9 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 24 Apr 2012 23:29:38 +0200 Subject: emacs.d/lisp/yasnippet: added yasnippet --- emacs.d/lisp/yasnippet/snippets/ruby-mode/definitions/cls | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 emacs.d/lisp/yasnippet/snippets/ruby-mode/definitions/cls (limited to 'emacs.d/lisp/yasnippet/snippets/ruby-mode/definitions/cls') diff --git a/emacs.d/lisp/yasnippet/snippets/ruby-mode/definitions/cls b/emacs.d/lisp/yasnippet/snippets/ruby-mode/definitions/cls new file mode 100644 index 0000000..64ef27e --- /dev/null +++ b/emacs.d/lisp/yasnippet/snippets/ruby-mode/definitions/cls @@ -0,0 +1,12 @@ +#name : class ... end +#contributor : hitesh +# -- +class ${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 -- cgit v1.2.3