mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-23 07:05:33 +08:00
Updated l theme to have rbenv support
This commit is contained in:
parent
6ae22a5950
commit
7154875cf0
|
@ -1,28 +1,29 @@
|
|||
# To show the right prompt please set
|
||||
# set fish_theme_l_right_prompt true (config.fish)
|
||||
# set theme_display_rbenv 'yes' (config.fish)
|
||||
# set theme_display_rbenv_gemset 'yes' (config.fish)
|
||||
|
||||
if test "$fish_theme_l_right_prompt" = true
|
||||
function _ruby_version
|
||||
echo (command rbenv version-name | sed 's/\n//')
|
||||
end
|
||||
|
||||
function _ruby_version
|
||||
echo (command rbenv version-name | sed 's/\n//')
|
||||
end
|
||||
function _ruby_gemset
|
||||
echo (command rbenv gemset active ^/dev/null | sed -e 's| global||')
|
||||
end
|
||||
|
||||
function _ruby_gemset
|
||||
echo (command rbenv gemset active ^/dev/null | sed -e 's| global||')
|
||||
end
|
||||
|
||||
function fish_right_prompt
|
||||
function fish_right_prompt
|
||||
if [ "$theme_display_rbenv" = 'yes' ]
|
||||
set -l red (set_color red)
|
||||
set -l normal (set_color normal)
|
||||
|
||||
set ruby_info $red(_ruby_version)
|
||||
|
||||
if [ (_ruby_gemset) ]
|
||||
set -l ruby_gemset $red(_ruby_gemset)
|
||||
set ruby_info "$ruby_info@$ruby_gemset"
|
||||
if [ "$theme_display_rbenv_gemset" = 'yes' ]
|
||||
if [ (_ruby_gemset) ]
|
||||
set -l ruby_gemset $red(_ruby_gemset)
|
||||
set ruby_info "$ruby_info@$ruby_gemset"
|
||||
end
|
||||
end
|
||||
|
||||
echo -n -s $ruby_info $normal
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -15,7 +15,8 @@ A theme inspired by [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh/blob/m
|
|||
Only if fish_theme_l_right_prompt variable is set true within config.fish
|
||||
|
||||
```fish
|
||||
set fish_theme_l_right_prompt true
|
||||
set theme_display_rbenv 'yes'
|
||||
set theme_display_rbenv_gemset 'yes'
|
||||
```
|
||||
|
||||
* Rbenv Ruby Version
|
||||
|
|
Loading…
Reference in New Issue
Block a user