Kungsgeten / yankpad

Paste snippets from an org-mode file
MIT License
216 stars 18 forks source link

yas-wrap-around-region per snippet setting #33

Closed zeltak closed 6 years ago

zeltak commented 6 years ago

Hi

i found out that in yasnippet one can set eh yas-wrap-around-region variable on a per snippet setting. its cool that you can use the "If non-nil insert region contents" to mark a region and then expand the snippet to have that region "pasted" into the completed expansion.

# -*- mode: snippet -*-
2   # name: to-say
3   # key: say
4   # expand-env : ((yas-wrap-around-region t))

#or

# name: C comment - 1992 classic
2   # expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))
3   # --

can i define this currently in yankpad? and if not can i request support for yas-wrap-around-region per snippet?

thx

Z

Kungsgeten commented 6 years ago

It is not possible to use this on a per snippet setting in yankpad at the moment, but it works if you globally set yas-wrap-around-region to t. It should be possible to add an option in yankpad to do it per snippet though, in a way similar to the indent_ tags.

Kungsgeten commented 6 years ago

The tags :wrap: and :wrap_nil: has been added. I tried to add functionality for registers too (which yas-wrap-around-region seems to support), but I couldn't get it to work.