4 ms·
You can also set the PATH_DIRS shell option and type, e.g. `blog/publish` if you have a ~/bin/blog directory full of scripts. Easier than an underscore. I mean
by ianthehenry 4y ago
You can also set the PATH_DIRS shell option and type, e.g. `blog/publish` if you have a ~/bin/blog directory full of scripts. Easier than an underscore.
I mean, yeah, sd is only a marginal improvement over not sd. It's not a lifechanging script. The differences are:
1. sd makes it easier to create new scripts. Instead of vim ~/bin/blog_publish, writing out the shebang, chmod +x ~/bin/blog_publish, you say `sd blog publish --new`. It sets the permissions and preloads it with a template.
2. Ditto for for other convenience commands: `sd blog publish --edit`, `sd blog publish --cat`.
3. Auto-generates usage text in the autocomplete menu.
4. sd scripts exist in a separate autocomplete namespace from non-sd scripts. b<tab> gives you, you know, bison, binhex, any commands on your PATH. sd b<tab> gives you only your user scripts that start with b.
5. Hierarchical autocomplete is more convenient, if you have more than one level of namespacing.