fish prompt baby
This commit is contained in:
parent
de4fdf5aed
commit
96db22af52
@ -10,3 +10,5 @@ style = "Bold"
|
||||
family = "Hurmit Nerd Font"
|
||||
style = "Regular"
|
||||
|
||||
[window]
|
||||
padding = { x = 5, y = 5 }
|
||||
|
||||
25
.config/fish/functions/fish_prompt.fish
Normal file
25
.config/fish/functions/fish_prompt.fish
Normal file
@ -0,0 +1,25 @@
|
||||
function fish_prompt
|
||||
set -l last_status $status
|
||||
set -l user
|
||||
set -l dir
|
||||
set -l git
|
||||
set -l stat
|
||||
|
||||
set user (set_color magenta) '' (set_color black)(set_color -b magenta) ' ' (whoami) ' ' (set_color normal)(set_color magenta) '' (set_color normal)
|
||||
set dir (set_color black)(set_color -b blue) '' (set_color -b blue) ' '(prompt_pwd) ' ' (set_color normal)(set_color blue) '' (set_color normal)
|
||||
|
||||
if test -n (fish_git_prompt | string collect --allow-empty)
|
||||
set -g __fish_git_prompt_showdirtystate 1
|
||||
set git (set_color black)(set_color -b cyan) '' (set_color -b cyan) ' '(fish_git_prompt) ' ' (set_color normal)(set_color cyan) '' (set_color normal)
|
||||
else
|
||||
set git ""
|
||||
end
|
||||
|
||||
if test $last_status -ne 0
|
||||
set stat (set_color black)(set_color -b red) '' (set_color -b red) " " (set_color normal)(set_color red) '' (set_color normal)
|
||||
else
|
||||
set stat (set_color black)(set_color -b green) '' (set_color -b green) " " (set_color normal)(set_color green) '' (set_color normal)
|
||||
end
|
||||
string join '' $user $dir $git $stat ' '
|
||||
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user