dotfiles/.config/fish/functions/fish_prompt.fish

25 lines
783 B
Fish
Raw Normal View History

function fish_prompt --description 'Write out the prompt'
if test (id -u) -eq 0
set prompt_symbol '#'
else
set prompt_symbol '$'
end
2019-10-24 17:22:07 +02:00
set -l prompt_prefix (set_color yellow)(whoami)'@'(set_color purple)(prompt_hostname)' '
set -l prompt_dir (set_color green)(prompt_pwd)
set -l column_aware_prompt (construct_column_aware_prompt $prompt_prefix $prompt_dir)
if test -z $WINDOW
2019-10-24 17:22:07 +02:00
for dir in $column_aware_prompt
echo $dir
end
set_color normal
echo $prompt_symbol' '
else
2019-10-24 17:22:07 +02:00
printf '%s%s@%s%s%s (%s)%s%s%s\n%s ' (set_color yellow) (whoami) (set_color purple) (prompt_hostname) (set_color white) (echo $WINDOW) (set_color green) (prompt_pwd) (set_color normal) $prompt_symbol
end
end