From 32e6b0368c9efeb05131cb07795bc0abf0cc3cd9 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 19 Jun 2016 16:52:06 +0200 Subject: Add `virtualfish` to fish config, prompt --- fish/.config/fish/config.fish | 1 + fish/.config/fish/functions/fish_prompt.fish | 10 ++++------ fish/.config/fish/functions/fish_right_prompt.fish | 5 +++++ 3 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 fish/.config/fish/functions/fish_right_prompt.fish (limited to 'fish') diff --git a/fish/.config/fish/config.fish b/fish/.config/fish/config.fish index f7fd5a4..c1d41a4 100644 --- a/fish/.config/fish/config.fish +++ b/fish/.config/fish/config.fish @@ -11,3 +11,4 @@ alias dict='sdcv' alias mp3-dl='youtube-dl --extract-audio --audio-format mp3' eval (dircolors -c ~/.dir_colors) +eval (python -m virtualfish) diff --git a/fish/.config/fish/functions/fish_prompt.fish b/fish/.config/fish/functions/fish_prompt.fish index 4a0c974..80804ed 100644 --- a/fish/.config/fish/functions/fish_prompt.fish +++ b/fish/.config/fish/functions/fish_prompt.fish @@ -23,6 +23,10 @@ function fish_prompt echo -n -s 'λ ' "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal" + if set -q VIRTUAL_ENV + echo -n -s ' (' (basename "$VIRTUAL_ENV") ') ' + end + if test $last_status -gt 0 set_color $fish_color_cwd_root echo -n -s ' ‣ ' @@ -31,9 +35,3 @@ function fish_prompt echo -n -s ' ‣ ' end end - -function fish_right_prompt - set_color $fish_color_autosuggestion - date '+%H:%M:%S' - set_color normal -end diff --git a/fish/.config/fish/functions/fish_right_prompt.fish b/fish/.config/fish/functions/fish_right_prompt.fish new file mode 100644 index 0000000..6bcfd23 --- /dev/null +++ b/fish/.config/fish/functions/fish_right_prompt.fish @@ -0,0 +1,5 @@ +function fish_right_prompt + set_color $fish_color_autosuggestion + date '+%H:%M:%S' + set_color normal +end -- cgit v1.2.3