mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
7 lines
344 B
Plaintext
7 lines
344 B
Plaintext
# -*- mode: snippet -*-
|
|
# key: sub
|
|
# contributor: Translated from TextMate Snippet
|
|
# name: sub(/../) { |match| .. }
|
|
## condition: "source.ruby"
|
|
# --
|
|
sub(/${1:pattern}/) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:match}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } |