It doesn't come much cheaper than the solution I use - I like to consider myself frugal, my wife has another phrase for it :-)
All my useful code is stored in individual files in a single snippets
directory. The first line of each contains:
KEYWORDS:A:B:C:
where A
, B
and C
are useful search terms such as perl
, c
or btree
.
The next few lines are often a description, mostly unnecessary since the code itself has extensive comments on how to use it.
Then when I want some code for a BTree implementation in COBOL, I just use a script snippet btree cobol
which boils down to:
grep '^KEYWORDS:' * | grep ':btree:' | grep ':cobol:'
along with other tools which can be run within vim
using !!
to insert a snippet directly into my current source code file.
Okay, so it's not the most speedy or elegant solution on the planet, but it works for me. And it easily handles the huge amounts of code I've collected over the last 30-odd years, in a format that's easy to recover and process.
$80 isn't really that expensive but I prefer a simple free solution that's guaranteed to be around, and working, longer than any software product I could purchase. If UNIX ever ships without grep
, I may change my mind, but it'll no doubt be replaced with another search tool I could drop in as easily.