bobthefish: allow user disable segments

Conflicts:
	themes/bobthefish/fish_prompt.fish
This commit is contained in:
Roman Inflianskas 2014-11-22 15:28:40 +03:00 committed by Bruno Pinto
parent 0e76751e5f
commit eec81de1b4

View File

@ -12,9 +12,16 @@
# #
# You can override some default options in your config.fish: # You can override some default options in your config.fish:
# #
# set -g theme_display_git no
# set -g theme_display_hg no
# set -g theme_display_virtualenv no
# set -g theme_display_user yes # set -g theme_display_user yes
# set -g default_user your_normal_user # set -g default_user your_normal_user
set -q theme_display_git; or set -g theme_display_git yes
set -q theme_display_hg; or set -g theme_display_hg yes
set -q theme_display_virtualenv; or set -g theme_display_virtualenv yes
set -g __bobthefish_current_bg NONE set -g __bobthefish_current_bg NONE
# Powerline glyphs # Powerline glyphs
@ -95,10 +102,12 @@ function __bobthefish_pretty_parent -d 'Print a parent directory, shortened to f
end end
function __bobthefish_git_project_dir -d 'Print the current git project base directory' function __bobthefish_git_project_dir -d 'Print the current git project base directory'
[ "$theme_display_git" = 'yes' ]; or return
command git rev-parse --show-toplevel ^/dev/null command git rev-parse --show-toplevel ^/dev/null
end end
function __bobthefish_hg_project_dir -d 'Print the current hg project base directory' function __bobthefish_hg_project_dir -d 'Print the current hg project base directory'
[ "$theme_display_hg" = 'yes' ]; or return
set d (pwd) set d (pwd)
while not [ $d = / ] while not [ $d = / ]
if test -e $d/.hg if test -e $d/.hg
@ -331,6 +340,7 @@ function __bobthefish_virtualenv_python_version -d 'Get current python version'
end end
function __bobthefish_prompt_virtualfish -d "Display activated virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself)" function __bobthefish_prompt_virtualfish -d "Display activated virtual environment (only for virtualfish, virtualenv's activate.fish changes prompt by itself)"
[ "$theme_display_virtualenv" = 'yes' ]; or return
set -q VIRTUAL_ENV; or return set -q VIRTUAL_ENV; or return
set -l version_glyph (__bobthefish_virtualenv_python_version) set -l version_glyph (__bobthefish_virtualenv_python_version)
if [ "$version_glyph" ] if [ "$version_glyph" ]