larkery / zsh-histdb

A slightly better history for zsh
MIT License
1.27k stars 75 forks source link

Add support for "tags" #131

Closed jbro closed 6 months ago

jbro commented 2 years ago

Would it be possible to add tags to commands by "misusing" that # is a comment? An example could be something like:

$ super-usefull-command --with parameter #tag1 #tag2 #tag3

The tags could be stored in a separate table and linked to commands with a foreign key, making it easy to get all commands with specific tag.

larkery commented 6 months ago

On my machine this already works without a table, e.g.

~
$ do-a-thing #one #two #three
do-a-thing: command not found
~
[127] $ do-another-thing #three
do-another-thing: command not found
~
$ histdb #three
time   ses   dir  cmd
09:46  1796  ~    do-a-thing #one #two #three
09:46  1796  ~    do-another-thing #three

there are some zsh settings to do with comments that might affect this, I don't know