Prompt time of command and jobs

This commit is contained in:
Daniel Flanagan 2022-10-11 22:59:06 -05:00
parent 8148aa62a6
commit 2e550272ad
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
2 changed files with 34 additions and 38 deletions

View file

@ -5,7 +5,7 @@ function get_hostname
end end
function fish_greeting function fish_greeting
set_color -b black brblack set_color -b normal brblack
printf "%s@%s %s\n" $USER (get_hostname) (date) printf "%s@%s %s\n" $USER (get_hostname) (date)
end end
@ -18,45 +18,37 @@ end
function fish_prompt function fish_prompt
set last_cmd_status $status set last_cmd_status $status
set prompt_str '$' if set -q SUDO_USER
if test (id -u) -eq 0 set_color -b yellow black
if test $last_cmd_status -eq 0 printf " SUDO "
set_color -b blue black set_color -b normal normal
else
set_color -b red black
end
printf " SUDO $USER@$hostname "
set prompt_str '#'
else
if test $last_cmd_status -eq 0
set_color blue
else
set_color red
end
printf '%s@%s' $USER (echo $hostname | cut -d '.' -f1)
end
set_color normal
printf " " printf " "
set_color magenta end
printf "%s" (preprocess_pwd) if test $last_cmd_status -eq 0
set_color -b black brblack set_color -b normal blue
printf "\n$prompt_str " else
set_color -b normal red
end
printf "$USER@$hostname"
set_color -b normal magenta
printf " %s" (preprocess_pwd)
set_color -b normal green
set -q CMD_DURATION && printf " %dms" $CMD_DURATION
if jobs -q
set_color -b normal cyan
printf " [jobs: %d]" (jobs -p | wc -l)
end
printf "\n"
set_color brblack
if test (id -u) -eq 0
printf "# "
else
printf '$ '
end
set_color -b normal normal
end end
function fish_mode_prompt; end function fish_mode_prompt; end
# function fish_right_prompt function fish_right_prompt
# set_color brblack end
# switch $fish_bind_mode
# case default
# echo 'N'
# case insert
# echo 'I'
# case replace_one
# echo 'R'
# case replace
# echo 'R'
# case visual
# echo 'V'
# end
# end

View file

@ -13,6 +13,10 @@ select = "underline"
[editor.file-picker] [editor.file-picker]
hidden = false hidden = false
[editor.indent-guides]
render = true
character = "🭰"
[keys.insert] [keys.insert]
j = { k = "normal_mode", j = "normal_mode", K = "normal_mode", J = "normal_mode" } j = { k = "normal_mode", j = "normal_mode", K = "normal_mode", J = "normal_mode" }
J = { k = "normal_mode", j = "normal_mode", K = "normal_mode", J = "normal_mode" } J = { k = "normal_mode", j = "normal_mode", K = "normal_mode", J = "normal_mode" }