On Aug 30, 2012, at 11:11 AM, Hans-Jörg Bibiko bibiko@eva.mpg.de wrote:
select: "something a_method(with, arguments)"
and invoke that snippet
${1:variable} = `echo -ne "$TM_SELECTED_TEXT" | perl -pe 's/^\s*\w+\s*//'` `echo -ne "$TM_SELECTED_TEXT" | perl -pe 's/^\s*(\w+)\s*.*/\1/'` ${1/\s*//}
Neat approach but no need to call out to shell / perl:
${1:variable} = ${TM_SELECTED_TEXT/\A\s*\w+\s*//} ${TM_SELECTED_TEXT/\A\s*(\w+).*/$1/} ${1}
And here’s a tip regarding selection: in 2.0 using a “unit selection”, i.e. the stuff under Edit → Select, using shift + movement will always extend selection, so e.g. with something like:
something a_method(with, arguments), something_else
Place caret inside parenthesis, use ⇧⌘B (select to enclosing pairs) and then one can use ⌥⇧← to extend the selection to the method name (with 1.x unit selections would produce a regular “anchored” selection, so using left/right movement would shrink/expand respectively).