I do something similar -- I show the duration of the command in a human readable format, but only if the command too more than 60 seconds; useful to get an idea of how long compilations (etc) take
One of my most useful changes is a script that garbage-collects my history file: deduplication, removal of sensitive + trivial commands. In combination with a FZF based history search that's shared between all shells, I effectively have a super-quick database of every command without any noise. See https://github.com/naggie/dotfiles/blob/master/scripts/clean... -- added via bash/zsh hooks.
> I show the duration of the command in a human readable format, but only if the command too more than 60 seconds
There is also a similar builtin feature [1] of ZSH. For example, you can put this in your .zshrc:
REPORTTIME=10
It instructs ZSH to report the time elapsed since the command was invoked (if it is above this threshold, 10 seconds in this case).
However, it just takes the CPU time into account. When using something like `sleep`, it won't trigger. There is a plugin [2] that covers this use case aswell.
why would you write an own script to sanitize your history manually? that sounds crazy, you can disallow duplicates and blacklist specific commands using normal shell configuration...
Because HISTCONTROL=ignoredups only deduplicates sequential commands, and having my own script allows specification of the blacklist in a non-redundant way between zsh and bash.
In addition, I can do it in such a way that the most recent invocation is deleted last. I can also use regexes.
See https://github.com/naggie/dotfiles/blob/master/home/.functio...
One of my most useful changes is a script that garbage-collects my history file: deduplication, removal of sensitive + trivial commands. In combination with a FZF based history search that's shared between all shells, I effectively have a super-quick database of every command without any noise. See https://github.com/naggie/dotfiles/blob/master/scripts/clean... -- added via bash/zsh hooks.