** Quickly finding snippets
-There are some ways you can quickly find a snippet file:
+There are some ways you can quickly find a snippet file or create a new one:
- =M-x yas-new-snippet=
- Prompts you for a snippet name, then tries to guess a suitable
- directory to store it, prompting you for creation if it does not
- exist. Finally, places you in a new buffer set to =snippet-mode= so
- you can write your snippet.
+ Creates a new buffer with a template for making a new snippet.
+ The buffer is in =snippet-mode= (see below). When you are done
+ editing the new snippet, use =C-c C-c= to save it. This will
+ prompt for a directory two steps: first, the snippet table
+ (with a default based on the major mode you started in), and then
+ then snippet collection directory (defaults to the first directory
+ in =yas-snippet-dirs=. (See [[file:snippet-organization.org][Organizing Snippets]]
+ for more detail on how snippets are organized.)
- =M-x yas-find-snippets=
This is optional and has no effect whatsoever on snippet functionality,
but it looks nice.
-* <<Template syntax>>
+* Template Syntax
The syntax of the snippet template is simple but powerful, very similar
to TextMate's.
They acts as the default value for a tab stop. But when you firstly
type at a tab stop, the default value will be replaced by your typing.
-The number can be omitted if you don't want to create [[mirrors]] or
-[[transformations]] for this field.
+The number can be omitted if you don't want to create [[mirrors-fields][mirrors]] or
+[[mirror-transformations][transformations]] for this field.
-** <<Mirrors>>
+** Mirrors <<mirrors-fields>>
We refer the tab stops with placeholders as a /field/. A field can have
mirrors. Its mirrors will get updated when you change the text of a
none of the tab stops has an initial value, the first one is selected as
the field and others mirrors.
-** Mirrors with <<transformations>>
+** Mirrors with transformations <<mirror-transformations>>
If the value of an =${n:=-construct starts with and contains =$(=,
then it is interpreted as a mirror for field =n= with a
By the way, =C-d= will only clear the field if you cursor is at the
beginning of the field /and/ it hasn't been changed yet. Otherwise, it
performs the normal Emacs =delete-char= command.
+
+** Indentation markers
+
+If [[sym:yas-indent-line][=yas-indent-line=]] is *not* set to '=auto=, it's still possible to
+indent specific lines by adding an indentation marker, =$>=, somewhere
+on the line.