Hacker News new | past | comments | ask | show | jobs | submit login

That presentation is based on Gilles Castel's approach to snippet design. Mine has a fairly different philosophy with greater emphasis on visual representation. For example, my snippets for inverse limit and the empty set:

    snippet lim<- "inverse limit" iA 
    \varprojlim
    endsnippet

    snippet o/ "Empty set" wA
    \emptyset 
    endsnippet
However, whichever you prefer, I highly recommend looking into the following two snippet classes of mine:

    snippet !! "inline math mode postfix" A
    \$$0\$
    endsnippet

    snippet "(\S+)!!" "inline math mode postfix" Ar
    \$`!p snip.rv = match.group(1)`\$
    endsnippet

    snippet "([A-Za-z]+)@@" "Autoformatting common functions" rA
    \\`!p snip.rv = match.group(1)`{$0}
    endsnippet
Although they are very simple, I am extremely proud of them because they make math insertion so much easier: they turn math mode and calling macros into a postfix call, which is very natural for most of us. Try them and I promise they will help.

To see how nice they are, to display $\log{\log{\log{x+1}}}$:

    !!log@@log@@log@@x+1



Rest in Peace Gilles


I came across his posts for the first time just last week and my mind was blown. I didn't know he was dead. Rest in peace.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: