Nix (home-manager) configurations for my computers
fish: Change prompt to a simple one
The default prompt displays git information, which is not only bloat but
also width-eating. On a branch with long name, the whole line will be
occupied and prompt symbol (">") will sit at the next line, which is
quite annoying especially on quitting pager software.
echo -n (set_color blue)(string join ", " $environment)
set_color normal
end
++function fish_prompt
+ # This is a simple prompt. It looks like
+ # alfa@nobby /path/to/dir $
+ # with the path shortened and colored
+ # and a "#" instead of a "$" when run as root.
+ set -l symbol ' $ '
+ set -l color $fish_color_cwd
+ if fish_is_root_user
+ set symbol ' # '
+ set -q fish_color_cwd_root
+ and set color $fish_color_cwd_root
+ end
++ echo -n $USER@$hostname
++ set_color $color
+ echo -n (prompt_pwd)
+ set_color normal
++ echo -n $symbol
+end