added new prompt updates
This commit is contained in:
@ -15,13 +15,13 @@ function fish_prompt
|
|||||||
set -l branch (git::branch_name ^/dev/null)
|
set -l branch (git::branch_name ^/dev/null)
|
||||||
set -l ref (git show-ref --head --abbrev | awk '{print substr($0,0,7)}' | sed -n 1p)
|
set -l ref (git show-ref --head --abbrev | awk '{print substr($0,0,7)}' | sed -n 1p)
|
||||||
|
|
||||||
|
printf '%s ' \U1F6E0
|
||||||
|
echo -n -s (red)"("(off)
|
||||||
|
|
||||||
if git::is_stashed
|
if git::is_stashed
|
||||||
echo -n -s (white)"^"(off)
|
echo -n -s (white)"^"(off)
|
||||||
end
|
end
|
||||||
|
|
||||||
printf '%s ' \U1F6E0
|
|
||||||
echo -n -s (red)"("(off)
|
|
||||||
|
|
||||||
if git::is_dirty
|
if git::is_dirty
|
||||||
printf (white)"*"(off)
|
printf (white)"*"(off)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -100,6 +100,7 @@ function fish_right_prompt
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Because of having a two line promt now we dont need right anymore so we dont print anything here atm
|
||||||
#printf (yellow)"("(off)$cwd(yellow)") "(off)
|
#printf (yellow)"("(off)$cwd(yellow)") "(off)
|
||||||
#printf (off)(date +%H(yellow):(off)%M(yellow):(off)%S)(off)"\n"
|
#printf (off)(date +%H(yellow):(off)%M(yellow):(off)%S)(off)"\n"
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
function prompt::awsenv
|
function prompt::awsenv
|
||||||
if test -n "$env"
|
if test -n "$env"
|
||||||
if [ $env = "prod" ]
|
if [ $env = "prod" ]
|
||||||
|
printf '%s ' \U2601
|
||||||
echo -n -s (yellow)"["(red)"$env"(yellow)"]"(off)
|
echo -n -s (yellow)"["(red)"$env"(yellow)"]"(off)
|
||||||
else
|
else
|
||||||
|
printf '%s ' \U2601
|
||||||
echo -n -s (yellow)"["(off)"$env"(yellow)"]"(off)
|
echo -n -s (yellow)"["(off)"$env"(yellow)"]"(off)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -10,17 +12,26 @@ end
|
|||||||
|
|
||||||
function prompt::pyenv
|
function prompt::pyenv
|
||||||
if test -n "$PYENV_VERSION"
|
if test -n "$PYENV_VERSION"
|
||||||
echo -n -s (yellow)"["(cyan)"$PYENV_VERSION"(yellow)"]"(off)
|
echo -n -s (yellow)(printf '%s' \U1F40D)"["(cyan)"$PYENV_VERSION"(off)"@"(python -c "import sys;t='{v[0]}.{v[1]}.{v[2]}'.format(v=list(sys.version_info[:3]));sys.stdout.write(t)")(yellow)"]"(off)
|
||||||
|
else if test (command -v pyenv)
|
||||||
|
echo -n -s (yellow)(printf '%s' \U1F40D)"["(cyan)(pyenv version-name | sed 's/:.*$//' )(off)"@"(python -c "import sys;t='{v[0]}.{v[1]}.{v[2]}'.format(v=list(sys.version_info[:3]));sys.stdout.write(t)")(yellow)"]"(off)
|
||||||
|
else if test (command -v python)
|
||||||
|
echo -n -s (yellow)(printf '%s' \U1F40D)"["(cyan)(python -c "import sys;t='{v[0]}.{v[1]}.{v[2]}'.format(v=list(sys.version_info[:3]));sys.stdout.write(t)")(yellow)"]"(off)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function t31m_prompt
|
function t31m_prompt
|
||||||
|
|
||||||
set awsenv (prompt::awsenv)
|
set awsenv (prompt::awsenv)
|
||||||
set pyenv (prompt::pyenv)
|
set pyenv (prompt::pyenv)
|
||||||
#echo -n -s (red)"$awsenv"(cyan)"$pyenv"
|
|
||||||
echo -n -s "$pyenv"
|
echo -n -s "$pyenv"
|
||||||
printf '%s ' \U2601
|
|
||||||
echo -n -s "$awsenv"
|
echo -n -s "$awsenv"
|
||||||
|
|
||||||
|
# get time since last command finished
|
||||||
|
if test $CMD_DURATION
|
||||||
|
# Show duration of the last command in seconds
|
||||||
|
set duration (echo "$CMD_DURATION 1000" | awk '{printf "%.3fs", $1 / $2}')
|
||||||
|
printf '%s ' \U23F1
|
||||||
|
echo -n -s (red)$duration(off)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user