2012-10-16 09:45:46 +08:00
|
|
|
# name: Terlar
|
|
|
|
# author: terlar - https://github.com/terlar
|
|
|
|
|
|
|
|
function fish_prompt --description 'Write out the prompt'
|
2016-11-02 10:19:45 +08:00
|
|
|
set -l last_status $status
|
2012-10-16 09:45:46 +08:00
|
|
|
|
2016-11-02 10:19:45 +08:00
|
|
|
# User
|
|
|
|
set_color $fish_color_user
|
2019-09-19 14:35:16 +08:00
|
|
|
echo -n $USER
|
2016-11-02 10:19:45 +08:00
|
|
|
set_color normal
|
2012-10-16 09:45:46 +08:00
|
|
|
|
2016-11-02 10:19:45 +08:00
|
|
|
echo -n '@'
|
2012-10-16 09:45:46 +08:00
|
|
|
|
2016-11-02 10:19:45 +08:00
|
|
|
# Host
|
|
|
|
set_color $fish_color_host
|
|
|
|
echo -n (prompt_hostname)
|
|
|
|
set_color normal
|
2012-10-16 09:45:46 +08:00
|
|
|
|
2016-11-02 10:19:45 +08:00
|
|
|
echo -n ':'
|
2012-10-16 09:45:46 +08:00
|
|
|
|
2016-11-02 10:19:45 +08:00
|
|
|
# PWD
|
|
|
|
set_color $fish_color_cwd
|
|
|
|
echo -n (prompt_pwd)
|
|
|
|
set_color normal
|
2012-10-16 09:45:46 +08:00
|
|
|
|
2016-11-02 10:19:45 +08:00
|
|
|
__terlar_git_prompt
|
2019-02-09 23:03:52 +08:00
|
|
|
fish_hg_prompt
|
2016-11-02 10:19:45 +08:00
|
|
|
echo
|
2012-10-16 09:45:46 +08:00
|
|
|
|
2016-11-02 10:19:45 +08:00
|
|
|
if not test $last_status -eq 0
|
|
|
|
set_color $fish_color_error
|
|
|
|
end
|
2012-10-16 09:45:46 +08:00
|
|
|
|
2016-11-02 10:19:45 +08:00
|
|
|
echo -n '➤ '
|
|
|
|
set_color normal
|
2012-10-16 09:45:46 +08:00
|
|
|
end
|