snipp...lders(5)

๐Ÿ“ฆ
version 1.1.2 ยท 2 versions
, in nixpkgs unstable

๐ŸŽ€ NAME ๐ŸŽ€

okay so this is snippetexpander-placeholders(5) from the Snippet Expander Placeholders Format Manual, and itโ€™s literally the placeholders that can be used in Snippet Expander abbreviation bodies. bestie, this is your little cheat sheet for making snippets do cute dynamic stuff. ๐Ÿ’…โœจ


โœจ SYNTAX โœจ

All placeholders are delimited (wrapped) by $$, with the placeholder name starting with an @ symbol. no cap, thatโ€™s the whole vibe.

For example, todayโ€™s date can be inserted with $$@date$$. iconic.

Some placeholders allow for extra arguments when : follows their name and that is followed by the argument. For example a format for a date, or the abbreviation for a snippet. Check the following descriptions for each placeholder for more details, bestie.

To use $$ in your snippet body, escape the second $ with a backslash like so: $\$. yes, thatโ€™s the escape hatch. ๐Ÿซถ


๐Ÿ—“๏ธ @DATE & @TIME ๐Ÿ—“๏ธ

Quick examples, bestie:

  • Todayโ€™s date with system format: $$@date$$
  • Todayโ€™s date with custom format: $$@date:%Y-%m-%d %H:%M:%S$$
  • Tomorrowโ€™s date with system format: $$@date@+1D$$
  • Date 2 weeks from today with custom format: $$@date@+2W:%x$$
  • Time 3 hours from now: $$@time@+3H$$

@time is an alias for @date, with one important difference: the default output if no format specified is the default time format (%X) rather than default date format (%x). highkey important, donโ€™t mix that up. โฐ

The optional format specified after : can take a format string as detailed in the GLib.DateTime.format function's docs, see https://valadoc.org/glib-2.0/GLib.DateTime.format.html.

The optional date calculation starts with an @ after the placeholder name, followed by a signed integer and unit. The unit types are as follows:

  • Y: Years
  • M: Months
  • W: Weeks
  • D: Days
  • h: Hours
  • m: Minutes
  • s: Seconds

You can apply more than one date calculation, for example +2h+30m adds 2 hours and 30 minutes to the current time. stacking those little time math moments, we love to see it. ๐Ÿ”ฅ

You can use both positive (+) and negative calculations, for example -3D takes 3 days from the current date. time travel-ish, but make it snippet. ๐Ÿฆ‹


๐Ÿ“‹ @CLIPBOARD ๐Ÿ“‹

When $$@clipboard$$ is part of a snippetโ€™s body, when its abbreviation is expanded the current text contents of the clipboard will replace the placeholder. yes bestie, clipboard text just slides right in. ๐Ÿ’–


๐Ÿงฉ @SNIPPET ๐Ÿงฉ

You can have up to three levels of embedded snippets with the @snippet placeholder. nesting? in this economy? apparently yes, but only three levels deep.

The abbreviation for the snippet to be embedded is entered after :, for example $$@snippet:sigg;$$ expands the snippet with abbreviation sigg; in place of the placeholder. cute recursive-ish snippet moment. ๐ŸŽ€


๐Ÿ‘‘ @CURSOR ๐Ÿ‘‘

Adding $$@cursor$$ to a snippetโ€™s body will put the cursor in its place after expansion instead of at the end of the expanded text. main character cursor energy, honestly.

If $$@cursor$$ is entered more than once in a snippetโ€™s body or via snippet embedding, then the last occurrence of the cursor placeholder wins. periodt. the final cursor placement is the one that ate.

The @cursor placeholder does not work when using the shortcut to open the search and paste window rather than auto-expansion. lowkey important caveat, so donโ€™t come for the docs if that shortcut doesnโ€™t vibe with @cursor. ๐Ÿ’€


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

snippetexpander(1) snippetexpanderd(1) snippetexpanderx(1) snippetexpandergui(1)


๐Ÿ’– AUTHORS ๐Ÿ’–

Created and maintained by Ian Jones <ian@ianmjones.com>. Up-to-date sources can be found at https://git.sr.ht/~ianmjones/snippetexpander. Information on how to contribute and where bug reports and feature requests may be submitted can be found on the project page at https://snippetexpander.org. slay, give the maintainer some love. ๐Ÿซถ


and thatโ€™s the whole vibe check: snippetexpander-placeholders(5) (aka snipp...lders(5)) from the Snippet Expander Placeholders Format Manual, dated 1980-01-01. go forth and make your snippets adorable and useful, bestie ๐Ÿ’…โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from