Use comments for tagging successful commands on the command line
To make my life easier using the history substring search on my zsh environment I've set the option:
setopt interactivecomments # enable "#" in the shell
After that on every command that i'll use for a while I'll set the comments on the end of the line like this:
for prompt_name in `prompt -l | tail -1`; do prompt -p "${prompt_name}"; done; #prompt-preview
when i need to call the same command i will type the comment (without the hash) and the history substring search will do the rest. It is possible add multiple comments by separating them just use a semicolon at the end of each comment like this:
echo 'Spam'; #eggs; #ham
Written by Bruno Gama
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Related Tags
#shell
#zsh
#history
#search
#comments
#zshell
#hashtag
#substring
#zsh-history-substring-search
#like a boss
#say my name
#im the one who knocks
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#