help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

couple of simple yasnippet questions


From: andrea
Subject: couple of simple yasnippet questions
Date: Sat, 16 Jan 2010 19:28:44 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (darwin)

I end up to define every day new snippets and it's wonderful, but I
still have some problems when they become more complicated.

- bang
  with this I would just like to insert the right bang line depending on
  the mode.
  This thing below doesn't work...

--8<---------------cut here---------------start------------->8---
  #!$$envvar $$(cdr (assoc major-mode execlists))
--8<---------------cut here---------------end--------------->8---

- latex matrix
  I have to write sometimes latex matrices, but normally I write them
  inside org-mode.
  Would it be possible to make the *matrix* snippet only available for
  latex and org-mode?
  This is the snippet.
  
--8<---------------cut here---------------start------------->8---
# -*- mode: snippet -*-
# name: matrix
# key: matrix
# possible improvement, compute the number of lines from the argument to array
# --
\left \(
\begin{array}{${1:ccc}}
${2:v1 & v2} \\
$0
\end{array}
\right \)
--8<---------------cut here---------------end--------------->8---

  A wonderful thing that it could do is creating as many lines as I
  define in the "ccc" part, any idea on how to do it?

  Thanks





reply via email to

[Prev in Thread] Current Thread [Next in Thread]