diff --git a/README.md b/README.md index 9893a1f..6f8c4c2 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,8 @@ set -g theme_newline_prompt '$ ' - `theme_project_dir_length`. The same as `$fish_prompt_pwd_dir_length`, but for the path relative to the current project root. Defaults to `0`; set to any other number to show an abbreviated path. - `theme_newline_cursor`. Use `yes` to have cursor start on a new line. By default the prompt is only one line. When working with long directories it may be preferrend to have cursor on the next line. Setting this to `clean` instead of `yes` suppresses the caret on the new line. - `theme_newline_prompt`. Use a custom prompt with newline cursor. By default this is the chevron right glyph or `>` when powerline fonts are disabled. +- `theme_display_ranger`. Use `no` to completely hide all information about ranger. By default ranger shows 'R' symbol to indicate shell was created from ranger. +- `theme_display_ranger_level`. Use `yes` to also display information about ranger level. By default ranger level not is displayed. **Color scheme options** diff --git a/fish_prompt.fish b/fish_prompt.fish index 0a6a3f3..e375a7b 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -836,6 +836,21 @@ function __bobthefish_prompt_virtualgo -S -d 'Display current Go virtual environ set_color normal end +function __bobthefish_prompt_ranger -S -d 'Display current ranger indicator' + [ "$theme_display_ranger" = 'no' -o -z "$RANGER_LEVEL" ] + and return + + __bobthefish_start_segment $color_ranger + echo -ns $ranger_glyph + + if [ "$theme_display_ranger_level" = 'yes' ] + echo -ns "$RANGER_LEVEL" + end + + echo -ns ' ' + set_color normal +end + function __bobthefish_prompt_desk -S -d 'Display current desk environment' [ "$theme_display_desk" = 'no' -o -z "$DESK_ENV" ] and return @@ -1061,6 +1076,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome' __bobthefish_prompt_rubies __bobthefish_prompt_virtualfish __bobthefish_prompt_virtualgo + __bobthefish_prompt_ranger __bobthefish_prompt_nvm set -l real_pwd (__bobthefish_pwd) diff --git a/functions/__bobthefish_glyphs.fish b/functions/__bobthefish_glyphs.fish index 6d82b66..eaaa655 100644 --- a/functions/__bobthefish_glyphs.fish +++ b/functions/__bobthefish_glyphs.fish @@ -21,6 +21,7 @@ function __bobthefish_glyphs -S -d 'Define glyphs used by bobthefish' set -x ruby_glyph '' set -x go_glyph '' + set -x ranger_glyph 'R' # Desk glyphs set -x desk_glyph \u25F2