3

I recently installed the snipmate plugin, and I'm having a hard time understanding how it works. I have this in my tex.snippets file:

snippet begin \begin{} ... \end{} block
        \\begin{${1:env}}
                ${0:${VISUAL}}
        \\end{$1}

I am trying to master these snippets to improve my workflow. However, I don't understand how it works. When I press Tab, I have this

\begin{document}
$
\end{document}

This dollar sign appears in every tag. What is the keybinding behind it?

A Gold Man
  • 1,428

1 Answers1

3

The $ sign is a placeholder for where your cursor goes. The way the snipmate plugin works is that when you type in the keyword (begin in our case) and then press the trigger key (Tab by default), it fills in the snippet.

What follows is that you get

\begin{env}
   $
\end{env}

where your cursor is first placed where it say env, so you can type the name of the environment. Then, you can press the GoToNext key (also Tab by default) to move to the next placeholder, which is the $. Then you just type as normal and the $ sign disappears.

In terms of reading the snippets, the dollar signs represent where the placeholders will be put. You should really read the documentation that comes with the package, which is also available on the github page for the plugin.

A Gold Man
  • 1,428
  • Thanks for the info. I am looking for a good book that I can spend time with more like a latex cookbook rather than quick editing tutorials online. What would recommend? – vincent pham Dec 02 '17 at 05:33
  • @vincent the latex companion is old, but a good intro. I think the best way to learn is to keep your eyes open and hang out on stackexchange. by the way, you can accept an answer if it solved your problem by clicking the check mark next to it. – A Gold Man Dec 02 '17 at 17:41