Skip to content

Instantly share code, notes, and snippets.

@knu
Last active November 14, 2018 10:37
Show Gist options
  • Save knu/fd795064af2b32d3c1f1058b24e6429a to your computer and use it in GitHub Desktop.
Save knu/fd795064af2b32d3c1f1058b24e6429a to your computer and use it in GitHub Desktop.
Yasnippet: block-with-var for ruby-mode
# -*- mode: snippet -*-
# name: block-with-var
# --
{ |${1:var}| ${1:$(if (string-match "\\\\_<[a-z]\\\\sw*" yas-text) (match-string 0 yas-text))}.$0 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment