Simplify prompt and cleanup sync script tmp space handling

This commit is contained in:
mitchell 2020-11-05 19:51:51 -05:00
parent 2b7261fb62
commit a544dd57d1
3 changed files with 17 additions and 24 deletions

View file

@ -27,31 +27,29 @@ function fish_prompt --description 'Write out the prompt'
set color_cwd $fish_color_cwd
end
set suffix '#~>'
set suffix '#'
if test $fish_key_bindings = 'fish_vi_key_bindings'
switch "$fish_bind_mode"
case 'insert'
set suffix (set_color brblue) $suffix (set_color normal)
case 'default'
set suffix '###'
case 'visual'
set suffix (set_color bryellow) '<~#' (set_color normal)
set suffix (set_color bryellow) $suffix (set_color normal)
end
end
case '*'
set color_cwd $fish_color_cwd
set suffix '$~>'
set suffix '>'
if test $fish_key_bindings = 'fish_vi_key_bindings'
switch "$fish_bind_mode"
case 'insert'
set suffix (set_color brblue) $suffix (set_color normal)
case 'default'
set suffix '<$>'
set suffix '^'
case 'visual'
set suffix (set_color bryellow) '<~$' (set_color normal)
set suffix (set_color bryellow) 'v' (set_color normal)
end
end
end
@ -96,6 +94,11 @@ function fish_prompt --description 'Write out the prompt'
set git_branch ' on ' (set_color $branch_color) $cur_branch (set_color normal)
end
# Set user prefix, based on docker machine name
if test -n "$DOCKER_MACHINE_NAME"
set user_prefix (set_color blue) $DOCKER_MACHINE_NAME (set_color normal) ' '
end
# Set go version, by existence of go mod or dep files
if test -e ./go.mod; or test -e ./Gopkg.toml; and command -sq go
if test -z "$go_version"
@ -116,11 +119,6 @@ function fish_prompt --description 'Write out the prompt'
set -g docker_version
end
# Set user prefix, based on docker machine name
if test -n "$DOCKER_MACHINE_NAME"
set user_prefix (set_color blue) $DOCKER_MACHINE_NAME (set_color normal) ' '
end
# Set node (and ts) version, based on existance of package.json (and tsconfig.json)
if test -e ./package.json; and command -sq node
if test -z "$node_version"

View file

@ -1,9 +1,6 @@
# Borrowed from bobthefish theme (https://github.com/oh-my-fish/theme-bobthefish).
# Some functions borrowed from bobthefish theme (https://github.com/oh-my-fish/theme-bobthefish).
# Copyright (c) 2013-2014 Justin Hileman.
#
# Modifications:
# - Remove lines 75, 76, 78 of original file. Setting '<' as the default left arrow glyph.
#
# You can override some default right prompt options in your config.fish:
# set -g theme_date_format "+%a %H:%M"