Partially Ignoring History in Fish Shell

Created on 2020-11-19T21:47:48-06:00

Return to the Index

This card can also be read via Gemini.

Abbreviation

Abbreviating commands to they are always run with a preceding space, which avoids them being registered in history.

abbr --add nonsaved ' nonsaved'

Deletion after the fact

You can forget all history for particular commands:

history -delete 

An example was given having a function selectively delete history:

function delete-mplayer --on-event fish_postexec
    string match -qr '^mplayer' -- $argv
    and history delete --exact --case-sensitive -- (string trim -r $argv)
end

References