Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ranger indicator #230

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down
16 changes: 16 additions & 0 deletions fish_prompt.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions functions/__bobthefish_glyphs.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down