|
|
|
|
|
by ackyshake
449 days ago
|
|
I use bog-standard zsh without any plugins or any of the fancy stuff, but one of the most useful tricks I use is to leverage interactive comments. If I have a long command I know I run will frequently, I 'tag' them at the end by a shell comment[1]. So for example, I have one that I use to run software updates: softwareupdate --include-config-data --install --all --restart # system:update:restart
I have a similar one without the `--restart` option that I tag with `:norestart` instead, but you get the idea—I put related commands under a common term.Then I can just use the ctrl-r builtin keybinding, type `:system` and cycle through system related commands, or go exactly to the command I want. The beauty of this is that it also works in bash and systems I remote into (which I frequently need to do at work), without any extra plugins required. [1]: interactive comments are disabled by default in zsh, but can be enabled with `setopt interactive_comments` |
|