On a related note: has anyone used a good tool for using/inserting these kinds of custom snippets? It would be neat to have a snippet manager with quick search bound to a keypress.
I made my own with search and autocomplete, it works for me and I have it on GitHub, but it's pretty specific to my workflow and there are so many different options in this thread (a lot of which are probably better).
I also liked the idea here to prefix all your scripts https://news.ycombinator.com/item?id=31846902 and would personally recommend using fish or zsh with the improvements from ohmyzsh for autocomplete and hints.