snippetexpander(1)

πŸ“¦
version 1.1.2 Β· 2 versions
, in nixpkgs unstable

snippetexpander(1) πŸ’…

okay bestie, this is the snippetexpander(1) page from the Snippet Expander CLI Manual β€” yes, the Snippet Expander CLI manual, and we're about to make your snippet game iconic. ✨

✨ NAME ✨

snippetexpander β€” Snippet Expander CLI, no cap.

🌸 DESCRIPTION 🌸

Save your often-used text snippets, then expand them whenever you type their abbreviation. It's giving "type less, slay more" energy.

The example from the page: "ser`" expands to "Snippet Expander rules!".

πŸŽ€ SYNOPSIS πŸŽ€

snippetexpander --start
snippetexpander --stop
snippetexpander --status
snippetexpander --autostart={on|off|status}
snippetexpander --autoexpand={on|off|status}
snippetexpander -e|--export filename
snippetexpander -i|--import filename [--force]
snippetexpander -v|--version
snippetexpander -h|--help
snippetexpander help [-c|--command] command
snippetexpander add [-a|--abbreviation] abbreviation [-b|--body] body
snippetexpander autoexpand [--on|--off]
snippetexpander autostart [--on|--off]
snippetexpander copy [-u|--skip-last-used] [-a|--abbreviation] abbreviation
snippetexpander expand [-u|--skip-last-used] [-a|--abbreviation] abbreviation
snippetexpander export [[-f|--filename filename] | [filename]] [-v|--version int]
snippetexpander import [-f|--filename] filename [-u|--update]
snippetexpander list [-a|--abbreviation] [-b|--body] [-d|--delimiter delimiter] [-i|--id] [-l|--last-used] [-r|--recent] [[-s|--search string] | [string]]
snippetexpander ping [-r|--response response] [response]
snippetexpander remove [-a|--abbreviation] abbreviation

πŸ’… OPTIONS πŸ’…

  • --start β€” starts the daemon. πŸš€
  • --stop β€” stops the daemon. πŸ›‘
  • --status β€” gets the daemon status, and it exits with status 0 if running, 1 if not. iykyk.
  • --autoexpand={on|off|status} β€” turns auto expand of snippets "on", "off", or shows the "status" of the setting. πŸ¦‹
  • --autostart={on|off|status} β€” turns auto start of Snippet Expander on login "on", "off", or shows the "status" of the setting. 🌈
  • -e, --export=filename β€” exports snippets to file.
  • -i, --import=filename β€” imports snippets from file, and skips snippets where the abbreviation already exists.
  • --force β€” if used in conjunction with the import flag, existing snippets with the same abbreviation are updated. no duplicate drama.
  • -v, --version β€” displays the version number.
  • -h, --help β€” displays help.

πŸ› οΈ COMMANDS πŸ› οΈ

help command

Displays help for a given command.

  • -c, --command command β€” optional sub command to display help for if it's not given as a positional argument.

add abbreviation body

Creates a new snippet for a given abbreviation and body. ✨

  • -a, --abbreviation abbreviation β€” optional flag to specify the abbreviation for the new snippet if not using positional arguments.
  • -b, --body body β€” optional flag to specify the body for the new snippet if not using positional arguments.

autoexpand

Controls or gets status for whether snippets should auto expand. Calling the autoexpand command without any flags returns whether autoexpander is "on" or "off".

  • --off β€” turns off auto expand of snippets.
  • --on β€” turns on auto expand of snippets.

autostart

Controls or gets status for whether the daemon should auto start on login. Calling the autostart command without any flags returns whether autostart is "on" or "off".

  • --off β€” turns off auto start of Snippet Expander on login.
  • --on β€” turns on auto start of Snippet Expander on login.

copy abbreviation

Copies to the pasteboard the snippet's body with evaluated placeholders for the given abbreviation. πŸ“‹

  • -a, --abbreviation abbreviation β€” optional abbreviation for the snippet to be expanded and copied into the pasteboard if not given as a positional argument.
  • -u, --skip-last-used β€” do not update the last used date for the snippet.

expand abbreviation

Outputs the snippet's body with evaluated placeholders for the given abbreviation.

  • -a, --abbreviation abbreviation β€” optional abbreviation for the snippet to be expanded if not given as a positional argument.
  • -u, --skip-last-used β€” do not update the last used date for the snippet.

export filename

Saves snippets to a file.

  • -f, --filename filename β€” optional filename to be created, if not using the default, or positional argument. If not used, the default of snippets-YYYY-MM-DD.json will be used, where YYYY is the current year, MM the current month (01-12), and DD the day of the current month.
  • -v, --version int β€” optional legacy format version number. Currently, only 101 is supported, which is compatible with Snippet Pixie.

import filename

Imports snippets from file.

  • -f, --filename filename β€” optional filename to be imported if not given as a positional argument.
  • -u, --update β€” updates existing snippets with the same abbreviation. If this flag is not used, if an imported abbreviation already exists, it will not be altered, and the version in the file will not be imported.

list search_string

Searches and outputs a formatted list of snippets. All snippets will be output if no search string is supplied. πŸ‘‘

  • -a, --abbreviation β€” includes the abbreviation field (on by default if no fields specified).
  • -b, --body β€” includes the body field (on by default if no fields specified).
  • -d, --delimiter delimiter β€” changes the delimiter used to separate the displayed fields (default " ").
  • -i, --id β€” includes the id field.
  • -l, --last-used β€” includes the lastUsed datetime field.
  • -r, --recent β€” orders by most recently used.
  • -s, --search string β€” lists snippets where the abbreviation or body includes the search string, if not given as a positional argument.

ping response

Pings the daemon for an expected response string. If no response string is given, "pong" will be used by default. πŸ“

  • -r, --response response β€” optional response string to be returned, if not given as a positional argument, or not using default "pong".

remove abbreviation

Deletes a snippet. πŸ’€

  • -a, --abbreviation abbreviation β€” optional abbreviation for the snippet to be removed if not given as a positional argument.

🧠 NOTES 🧠

Abbreviations should be short, easy to remember, and hard to trigger accidentally. fr fr, this is the whole game.

It helps if an abbreviation includes either a key word from the fully expanded text, or an initialization or acronym that is part of it.

For example, if you regularly wrote "Snippet Expander" πŸ˜‰ you might use "se".

However, there are a lot of words that include the letter combination "se", (see https://www.wordfind.com/contains/se/), so there's a reasonably high chance that Snippet Expander would expand that abbreviation when you didn't want it to. not the vibe.

So instead it's common to add a "trigger character" to the end of the abbreviation. This is commonly a character that isn't found in normal sentences such as ` or ~ that is easy to find on your keyboard. Often just appending a space is enough, or doubling up characters.

I personally use ` (commonly known as grav or backtick) a lot as it's a single keystroke on my British layout keyboard just below my Escape key. So for me "se`" is a natural abbreviation for "Snippet Expander".

However, I could see using "se " or "se~" for the abbreviation.

If you do use a trailing space as your trigger character you might find it useful to include a trailing space in the text that is expanded, e.g. "se " expands to "Snippet Expander " as it's more natural when typing. 🫢

πŸ’€ LIMITATIONS πŸ’€

  • The cursor placeholder is not supported when using the CLI rather than auto-expansion.

πŸ”Ž SEE ALSO πŸ”Ž

snippetexpanderd(1) snippetexpanderx(1) snippetexpandergui(1) snippetexpander-placeholders(5)

πŸ‘‘ 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.


Footer check, bestie: this page is dated 1980-01-01, filed under snippetexpander(1), and lives in the Snippet Expander CLI Manual. Go make those snippets slay πŸ’–βœ¨

πŸ“¦ where this page comes from