From 061e2d6835a3b83eaa854bae11cb0627ed114767 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Sun, 14 Nov 2021 02:49:45 +0300 Subject: fish: python venv on prompt --- .config/fish/config.fish | 2 ++ .config/fish/functions/fish_right_prompt.fish | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to '.config/fish') diff --git a/.config/fish/config.fish b/.config/fish/config.fish index dd9c3fd..d0e9307 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -20,6 +20,8 @@ set --global --export WECHALLUSER "drocan" set --global --export WECHALLTOKEN "35624-0D38B-A2F16-A98B0-5963D-6DF19" set --global --export RUST_SRC_PATH (rustc --print sysroot)/lib/rustlib/src/rust/library/ set --global --export NLTK_DATA "$HOME/.local/share/nltk_data" +set --global --export VIRTUALFISH_HOME "$HOME/.envs" + if status is-interactive diff --git a/.config/fish/functions/fish_right_prompt.fish b/.config/fish/functions/fish_right_prompt.fish index 0dbcc37..5963ed9 100644 --- a/.config/fish/functions/fish_right_prompt.fish +++ b/.config/fish/functions/fish_right_prompt.fish @@ -1,4 +1,4 @@ -function fish_right_prompt -d "Write out the right prompt" +function fish_right_prompt --description 'Write out the right prompt' if not set -q -g __fish_right_prompt_functions_defined set -g __fish_right_prompt_functions_defined @@ -58,6 +58,7 @@ function fish_right_prompt -d "Write out the right prompt" set -l yellow (set_color -o yellow) set -l red (set_color -o red) set -l blue (set_color -o blue) + set -l green (set_color -o green) set -l repo_info if set -l repo_type (_repo_type) @@ -70,6 +71,11 @@ function fish_right_prompt -d "Write out the right prompt" end end + set -l virtualenv + if set -q VIRTUAL_ENV + set virtualenv "$green 🐍 " (basename "$VIRTUAL_ENV") + end + set hour $blue(date '+%R') - echo -n -s $repo_info ' ' $hour + echo -n -s $virtualenv ' ' $repo_info ' ' $hour end -- cgit v1.2.3-70-g09d2