Remove pyenv and add new shell theme

I enjoyed bobthefish quite a bit, but the nerd fonts on the CLI were
screwing up Emacs, and that's a non-starter for me.

One thing I like about cmorrell is that it has the host in the terminal
line, so I can tell which machine I'm on.
This commit is contained in:
Colin Powell
2018-12-11 21:41:59 -05:00
parent 69ed49c526
commit c3a2824089
12 changed files with 40 additions and 972 deletions

View File

@ -1,70 +1,29 @@
# You can override some default right prompt options in your config.fish:
# set -g theme_date_format "+%a %H:%M"
function __bobthefish_cmd_duration -S -d 'Show command duration'
[ "$theme_display_cmd_duration" = "no" ]; and return
[ -z "$CMD_DURATION" -o "$CMD_DURATION" -lt 100 ]; and return
function get_git_status -d "Gets the current git status"
if command git rev-parse --is-inside-work-tree >/dev/null 2>&1
set -l dirty (command git status -s --ignore-submodules=dirty | wc -l | sed -e 's/^ *//' -e 's/ *$//' 2> /dev/null)
set -l ref (command git describe --tags --exact-match ^/dev/null ; or command git symbolic-ref --short HEAD 2> /dev/null ; or command git rev-parse --short HEAD 2> /dev/null)
if [ "$CMD_DURATION" -lt 5000 ]
echo -ns $CMD_DURATION 'ms'
else if [ "$CMD_DURATION" -lt 60000 ]
__bobthefish_pretty_ms $CMD_DURATION s
else if [ "$CMD_DURATION" -lt 3600000 ]
set_color $fish_color_error
__bobthefish_pretty_ms $CMD_DURATION m
else
set_color $fish_color_error
__bobthefish_pretty_ms $CMD_DURATION h
end
if [ "$dirty" != "0" ]
set_color -b normal
set_color red
echo "$dirty changed file"
if [ "$dirty" != "1" ]
echo "s"
end
echo " "
set_color -b red
set_color white
else
set_color -b cyan
set_color white
end
set_color $fish_color_normal
set_color $fish_color_autosuggestion
[ "$theme_display_date" = "no" ]
or echo -ns ' ' $__bobthefish_left_arrow_glyph
echo " $ref "
set_color normal
end
end
function __bobthefish_pretty_ms -S -a ms interval -d 'Millisecond formatting for humans'
set -l interval_ms
set -l scale 1
switch $interval
case s
set interval_ms 1000
case m
set interval_ms 60000
case h
set interval_ms 3600000
set scale 2
end
switch $FISH_VERSION
# Fish 2.3 and lower doesn't know about the -s argument to math.
case 2.0.\* 2.1.\* 2.2.\* 2.3.\*
math "scale=$scale;$ms/$interval_ms" | string replace -r '\\.?0*$' $interval
case \*
math -s$scale "$ms/$interval_ms" | string replace -r '\\.?0*$' $interval
end
end
function __bobthefish_timestamp -S -d 'Show the current timestamp'
[ "$theme_display_date" = "no" ]; and return
set -q theme_date_format
or set -l theme_date_format "+%c"
echo -n ' '
date $theme_date_format
end
function fish_right_prompt -d 'bobthefish is all about the right prompt'
set -l __bobthefish_left_arrow_glyph \uE0B3
if [ "$theme_powerline_fonts" = "no" ]
set __bobthefish_left_arrow_glyph '<'
end
set_color $fish_color_autosuggestion
__bobthefish_cmd_duration
__bobthefish_timestamp
set_color normal
end
function fish_right_prompt -d "Prints right prompt"
get_git_status
end