package
0.6.0
Repository: https://github.com/sandro-h/snippet.git
Documentation: pkg.go.dev

# Functions

InstantiateArgs takes a snippet content and a map of argument names to values and replaces all instances of {arg} with the corresponding value in the map.
LoadSnippets loads a list of snippets from a YAML file.
MaxDur returns the larger of two durations.
MinDur returns the smaller of two durations.
ReloadSnippets reloads the snippets (usually when snippetsFile content changed), and transfers any runtime data of the old snippets to the matching new snippets.
SplitSpecials splits the string according to the individual special characters in the specials parameter.

# Constants

CopyModeNone uses regular typing instead of copy-pasting.
CopyModeNormal uses the standard Ctrl+V shortcut to copy-paste the snippet.
CopyModeShell uses the Ctrl+Shift+V shortcut to copy-paste the snippet into a terminal, where Ctrl+V usually doesn't work.

# Structs

ManualResolver marks arguments that require user input.
NowResolver resolves the argument to the current date and time.
RandomNumberResolver resolves the argument to a random integer number.
Snippet describes a snippet of text.
SnippetArg defines an argument to be replaced in the snippet.

# Interfaces

ArgResolver resolves the argument so it can be replaced in the snippet.

# Type aliases

CopyMode describes whether a snippet is copy-pasted instead of typed and in what fashion.