のユーザー構成と組み合わせて、(delete-selection-mode 1)
次の 2 つの Yasnippets を 1 つのスニペットに統合して、リージョンがアクティブかどうかによって動作が異なるようにする方法はありますか? 例えば: (if (region-active-p) (yas/selected-text) "$1")
アクティブな領域 -- アクティブな領域をスニペットで囲みます:
# -*- mode: snippet -*-
# contributor: lawlist
# key: bold_selected
# name: bold_selected
# binding: C-I b b s
# --
{\bf `yas/selected-text`}
非アクティブ領域 -- スニペットを挿入し、カーソルを次の位置に置きます$1
:
# -*- mode: snippet -*-
# contributor: lawlist
# key: bold
# name: bold
# binding: C-I b b b
# --
{\bf $1}