【发布时间】:2015-11-30 15:03:21
【问题描述】:
我知道 fish 不记得以 space 开头的命令,但是否可以添加忽略 Git 命令的规则?
【问题讨论】:
-
在 bash 中,有
$HISTIGNORE。不过,我不确定鱼。 -
我在documentation 中没有看到任何类似的内容。几乎是领先的空间。
我知道 fish 不记得以 space 开头的命令,但是否可以添加忽略 Git 命令的规则?
【问题讨论】:
$HISTIGNORE。不过,我不确定鱼。
灵感来自mnagle's answer,但具有特定于鱼类的功能:
如果您将git 的abbreviation 添加到“git”,那么fish 会在您的每个 git 命令之前插入一个空格!
abbr -a git ' git'
【讨论】:
这个 hack 怎么样:alias git=" git"
【讨论】:
这是一个核选项,但它可能是您的最佳选择:
function git
command git $argv
set history_items (history --search --prefix git)
for item in $history_items
history --delete $item
end
end
【讨论】: