mirror of
https://github.com/ViViDboarder/shoestrap.git
synced 2024-11-21 22:26:32 +00:00
Make fish prompt overridable
This commit is contained in:
parent
759715946e
commit
94a3ad358e
@ -1,5 +1,3 @@
|
|||||||
# TODO: Eventually... make pluggable so plugins can add to prompt
|
|
||||||
|
|
||||||
# This is exported because the venv is now included here
|
# This is exported because the venv is now included here
|
||||||
set -xg VIRTUAL_ENV_DISABLE_PROMPT 1
|
set -xg VIRTUAL_ENV_DISABLE_PROMPT 1
|
||||||
|
|
||||||
@ -9,17 +7,22 @@ set -xg VIRTUAL_ENV_DISABLE_PROMPT 1
|
|||||||
function _force_target
|
function _force_target
|
||||||
if [ (git config force.use) ]
|
if [ (git config force.use) ]
|
||||||
set -l org (force-target)
|
set -l org (force-target)
|
||||||
echo " [$org]"
|
echo "[$org]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function _virtual_env
|
function _virtual_env
|
||||||
if [ $VIRTUAL_ENV ]
|
if [ $VIRTUAL_ENV ]
|
||||||
set -l venv (basename "$VIRTUAL_ENV")
|
set -l venv (basename "$VIRTUAL_ENV")
|
||||||
echo " [$venv]"
|
echo "[$venv]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function _right_prompt_aux
|
||||||
|
# To override use `funced _fish_right_prompt_user; and funcsave _fish_right_prompt_user`
|
||||||
|
functions -q _fish_right_prompt_user; and _fish_right_prompt_user
|
||||||
|
end
|
||||||
|
|
||||||
function fish_right_prompt
|
function fish_right_prompt
|
||||||
set -l cyan (set_color -o cyan)
|
set -l cyan (set_color -o cyan)
|
||||||
set -l yellow (set_color -o yellow)
|
set -l yellow (set_color -o yellow)
|
||||||
@ -28,6 +31,6 @@ function fish_right_prompt
|
|||||||
set -l green (set_color -o green)
|
set -l green (set_color -o green)
|
||||||
set -l normal (set_color normal)
|
set -l normal (set_color normal)
|
||||||
|
|
||||||
echo -n $green (_force_target) (_virtual_env)
|
echo -n $green (_force_target) (_virtual_env) (_right_prompt_aux)
|
||||||
set_color normal
|
set_color normal
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user