From 83345ba6944c6afbe9f915fb5a5e06d0833e083b Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Sat, 21 Sep 2013 12:18:02 +0200 Subject: [PATCH] Improve ruby `desc` snippet Instead of dummy text, first argument for `describe` becomes a class name derived from a file name. Example: file: some_class_spec.rb describe argument: SomeClass --- snippets/ruby.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index e9d7ba3..cbfc85e 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -957,7 +957,7 @@ snippet tctss # Rspec snippets # ########################## snippet desc - describe ${1:class_name} do + describe ${1:`substitute(substitute(vim_snippets#Filename(), '_spec$', '', ''), '\(_\|^\)\(.\)', '\u\2', 'g')`} do ${0} end snippet descm