Add chruby item (#100)

* Add ruby item

* Rename chruby test

Co-authored-by: Ilan Cosman <ilancosman@gmail.com>
This commit is contained in:
Piotr Usewicz 2021-02-28 17:52:11 +01:00 committed by GitHub
parent 953203adcf
commit 4f621eae3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 44 additions and 9 deletions

View File

@ -0,0 +1,6 @@
function _tide_item_chruby
if test -n "$RUBY_VERSION"
set_color $tide_chruby_color
printf '%s' $tide_chruby_icon' ' $RUBY_VERSION
end
end

View File

@ -64,10 +64,13 @@ tide_right_prompt_frame_enabled true
tide_right_prompt_item_separator_diff_color '' tide_right_prompt_item_separator_diff_color ''
tide_right_prompt_item_separator_same_color '' tide_right_prompt_item_separator_same_color ''
tide_right_prompt_item_separator_same_color_color 949494 tide_right_prompt_item_separator_same_color_color 949494
tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' 'nvm' 'virtual_env' 'rust' 'php' 'vi_mode' tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' 'nvm' 'virtual_env' 'rust' 'php' 'vi_mode' 'chruby'
tide_right_prompt_pad_items true tide_right_prompt_pad_items true
tide_right_prompt_prefix '' tide_right_prompt_prefix ''
tide_right_prompt_suffix '' tide_right_prompt_suffix ''
tide_chruby_bg_color CC342D
tide_chruby_color white
tide_chruby_icon ''
tide_rust_bg_color 444444 tide_rust_bg_color 444444
tide_rust_color 00AFAF tide_rust_color 00AFAF
tide_rust_icon '' tide_rust_icon ''

View File

@ -33,6 +33,8 @@ tide_pwd_color_dirs cyan
tide_pwd_color_truncated_dirs magenta tide_pwd_color_truncated_dirs magenta
tide_right_prompt_frame_color brblack tide_right_prompt_frame_color brblack
tide_right_prompt_item_separator_same_color_color brblack tide_right_prompt_item_separator_same_color_color brblack
tide_chruby_bg_color black
tide_chruby_color red
tide_rust_bg_color black tide_rust_bg_color black
tide_rust_color cyan tide_rust_color cyan
tide_status_failure_bg_color black tide_status_failure_bg_color black

View File

@ -64,10 +64,13 @@ tide_right_prompt_frame_enabled false
tide_right_prompt_item_separator_diff_color ' ' tide_right_prompt_item_separator_diff_color ' '
tide_right_prompt_item_separator_same_color ' ' tide_right_prompt_item_separator_same_color ' '
tide_right_prompt_item_separator_same_color_color 949494 tide_right_prompt_item_separator_same_color_color 949494
tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' 'nvm' 'virtual_env' 'rust' 'php' tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' 'nvm' 'virtual_env' 'rust' 'php' 'chruby'
tide_right_prompt_pad_items false tide_right_prompt_pad_items false
tide_right_prompt_prefix ' ' tide_right_prompt_prefix ' '
tide_right_prompt_suffix '' tide_right_prompt_suffix ''
tide_chruby_bg_color normal
tide_chruby_color CC342D
tide_chruby_icon ''
tide_rust_bg_color normal tide_rust_bg_color normal
tide_rust_color 00AFAF tide_rust_color 00AFAF
tide_rust_icon '' tide_rust_icon ''

View File

@ -33,6 +33,8 @@ tide_pwd_color_dirs cyan
tide_pwd_color_truncated_dirs magenta tide_pwd_color_truncated_dirs magenta
tide_right_prompt_frame_color brblack tide_right_prompt_frame_color brblack
tide_right_prompt_item_separator_same_color_color brblack tide_right_prompt_item_separator_same_color_color brblack
tide_chruby_bg_color normal
tide_chruby_color red
tide_rust_bg_color normal tide_rust_bg_color normal
tide_rust_color cyan tide_rust_color cyan
tide_status_failure_bg_color normal tide_status_failure_bg_color normal

View File

@ -64,10 +64,13 @@ tide_right_prompt_frame_enabled true
tide_right_prompt_item_separator_diff_color '' tide_right_prompt_item_separator_diff_color ''
tide_right_prompt_item_separator_same_color '' tide_right_prompt_item_separator_same_color ''
tide_right_prompt_item_separator_same_color_color 949494 tide_right_prompt_item_separator_same_color_color 949494
tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' 'nvm' 'virtual_env' 'rust' 'php' 'vi_mode' tide_right_prompt_items 'status' 'cmd_duration' 'context' 'jobs' 'nvm' 'virtual_env' 'rust' 'php' 'vi_mode' 'chruby'
tide_right_prompt_pad_items true tide_right_prompt_pad_items true
tide_right_prompt_prefix '' tide_right_prompt_prefix ''
tide_right_prompt_suffix '' tide_right_prompt_suffix ''
tide_chruby_bg_color CC342D
tide_chruby_color white
tide_chruby_icon ''
tide_rust_bg_color FF8700 tide_rust_bg_color FF8700
tide_rust_color 2E3436 tide_rust_color 2E3436
tide_rust_icon '' tide_rust_icon ''

View File

@ -33,6 +33,8 @@ tide_pwd_color_dirs brwhite
tide_pwd_color_truncated_dirs white tide_pwd_color_truncated_dirs white
tide_right_prompt_frame_color brblack tide_right_prompt_frame_color brblack
tide_right_prompt_item_separator_same_color_color brblack tide_right_prompt_item_separator_same_color_color brblack
tide_chruby_bg_color red
tide_chruby_color black
tide_rust_bg_color yellow tide_rust_bg_color yellow
tide_rust_color black tide_rust_color black
tide_status_failure_bg_color red tide_status_failure_bg_color red

View File

@ -0,0 +1,14 @@
# RUN: %fish %s
function _chruby
_tide_decolor (_tide_item_chruby)
end
set -lx RUBY_VERSION
_chruby # CHECK:
set -lx RUBY_VERSION 3.0.0
set -lx tide_chruby_icon
_chruby # CHECK:  3.0.0