本文介绍了如何在鱼壳中定义别名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在鱼中定义一些别名.显然应该可以在
I would like to define some aliases in fish. Apparently it should be possible to define them in
~/.config/fish/functions
但是当我重新启动外壳程序时它们不会自动加载.有什么想法吗?
but they don't get auto loaded when I restart the shell. Any ideas?
推荐答案
只需使用alias
.这是一个基本示例:
Just use alias
. Here's a basic example:
# Define alias in shell
alias rmi "rm -i"
# Define alias in config file
alias rmi="rm -i"
# This is equivalent to entering the following function:
function rmi
rm -i $argv
end
# Then, to save it across terminal sessions:
funcsave rmi
最后一条命令创建文件~/.config/fish/functions/rmi.fish
.
This last command creates the file ~/.config/fish/functions/rmi.fish
.
感兴趣的人们可能想在官方手册.
Interested people might like to find out more about fish aliases in the official manual.
这篇关于如何在鱼壳中定义别名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!