Terminal 设置鱼壳剖面

Terminal 设置鱼壳剖面,terminal,fish,Terminal,Fish,我正试图通过~/.config/fish/config.fish命令设置我的鱼壳配置文件。我没有config.fish文件,必须在安装后创建自己的文件 我想更新此配置文件的主要原因是在终端中显示我当前的GitHub位置。我在网上找到了以下设置: set -g -x fish_greeting '' # fish git prompt set __fish_git_prompt_showdirtystate 'yes' set __fish_git_prompt_showstashstate 'y

我正试图通过~/.config/fish/config.fish命令设置我的鱼壳配置文件。我没有config.fish文件,必须在安装后创建自己的文件

我想更新此配置文件的主要原因是在终端中显示我当前的GitHub位置。我在网上找到了以下设置:

set -g -x fish_greeting ''
# fish git prompt
set __fish_git_prompt_showdirtystate 'yes'
set __fish_git_prompt_showstashstate 'yes'
set __fish_git_prompt_showupstream 'yes'
set __fish_git_prompt_color_branch yellow
# Status Chars
set __fish_git_prompt_char_dirtystate ' '
set __fish_git_prompt_char_stagedstate '→'
set __fish_git_prompt_char_stashstate '↩'
set __fish_git_prompt_char_upstream_ahead '↑'
set __fish_git_prompt_char_upstream_behind '↓'
function fish_prompt
printf ' '
set last_status $status
set_color $fish_color_cwd
printf '%s' (prompt_pwd)
set_color normal
printf '%s ' (__fish_git_prompt)
set_color normal
end
alias ls='ls -GFh'
alias fishprofile='nano ~/.config/fish/config.fish'
alias reboot='source ~/.config/fish/config.fish'
alias home='cd $HOME/Desktop'
function nvm
bass source ~/.nvm/nvm.sh ';' nvm $argv
end
cd ~/Desktop

代码粘贴到文件路径后,我可以访问当前GitHub终端位置,但一旦终端重新启动,此功能就消失了。关于如何保存此设置,您有什么想法吗?

如果您使用Fish方式进行操作,则不需要config.Fish文件。上面显示的内容是出于兼容性原因,并试图安抚配置文件用户。Fish的做法是在位于~/.config/Fish/functions/的单个文件中定义函数(而不是别名)。变量在命令行上设置和导出,并且是持久的


有关我的观点的更多信息,请参阅。

听起来您没有将该代码放入config.fish文件中。你在猫~/.config/fish/config.fish中看到了什么??猫命令中没有任何东西,这是你的问题。创建缺少的目录,编辑文件并添加所需内容。