Ubuntu 向fish shell配置中添加自定义脚本

Ubuntu 向fish shell配置中添加自定义脚本,ubuntu,fish,Ubuntu,Fish,我想将脚本添加到fishshell配置中,就像Ubuntu上的默认bash一样: ## Auto load nvm when there's a .nvmrc file OLD_PWD="" promptCommand() { if [ "$OLD_PWD" != "$PWD" ] ; then OLD_PWD="$PWD" if [ -e .nvmrc ] ; then nvm use; fi

我想将脚本添加到fishshell配置中,就像Ubuntu上的默认bash一样:

## Auto load nvm when there's a .nvmrc file
OLD_PWD=""
promptCommand() {
    if [ "$OLD_PWD" != "$PWD" ] ;
        then
        OLD_PWD="$PWD"
        if [ -e .nvmrc ] ;
            then nvm use;
        fi
    fi
}
export PROMPT_COMMAND=promptCommand
但是我没有找到fishshell的文件配置

是否有人已在鱼中添加自定义脚本


谢谢大家!

请参考以下链接

如何在每次登录时运行命令?fish相当于什么?bashrc?

编辑文件~/.config/fish/config.fish,如果它不存在则创建它(注意前导句点)