From 956a0379070fae387f5edd9ecd6f19dd09673228 Mon Sep 17 00:00:00 2001 From: MatejKastak Date: Sun, 22 Dec 2019 00:54:02 +0100 Subject: [PATCH 1/2] prompt: Add ranger indicator --- fish_prompt.fish | 16 ++++++++++++++++ functions/__bobthefish_glyphs.fish | 1 + 2 files changed, 17 insertions(+) diff --git a/fish_prompt.fish b/fish_prompt.fish index 470d1424..5eb06746 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -851,6 +851,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 @@ -1077,6 +1092,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 6d82b664..eaaa6559 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 From 0fe7c51a695f7a77decf03af62d05274af0978f5 Mon Sep 17 00:00:00 2001 From: MatejKastak Date: Mon, 23 Dec 2019 15:56:25 +0100 Subject: [PATCH 2/2] README: Add information about ranger configuration --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 05a22de0..085b2c75 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,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**