I got a simple snippet for the opening a file in PHP:
fopen('${1:./filename.txt}', '${2:$$(yas-choose-value '("r" "w" "a" "x" "r+" "w+" "a+" "x+"))}') or die();
So when I get to the choose the file opening mode, r,w,a,x... I get the dropdown:
r
w
a
.
But I would like to add a description of whats the function of each mode, like:
r - Open read only
w - Open for write erases content
.
.
Is it possible to do this with yas-choose-value
?
yas-choose-value
oryas-completing-read
. There are a handful of built-in functions, but you (or another forum participant) is free to write a custom function. It looks like this:(unless (or yas-moving-away-p yas-modified-p) ...)
with the...
needing to be replaced with the custom Lisp that does whatever you want.