Switch to using a fish theme with a hostname #fishshell
This commit is contained in:
@ -4,4 +4,4 @@ fishgretel/fasd
|
|||||||
2m/fish-gpg-tty
|
2m/fish-gpg-tty
|
||||||
asdf-vm/asdf
|
asdf-vm/asdf
|
||||||
edc/bass
|
edc/bass
|
||||||
oh-my-fish/theme-l
|
oh-my-fish/theme-mtahmed
|
||||||
|
|||||||
@ -1,37 +1,12 @@
|
|||||||
# To show the right prompt please set
|
# name: mtahmed
|
||||||
# set theme_display_rbenv 'yes' (config.fish)
|
# Left prompt:
|
||||||
# set theme_display_rbenv_gemset 'yes' (config.fish)
|
# - First 10 characters of hostname if ssh'ed
|
||||||
# set theme_display_rbenv_with_gemfile_only 'yes' (config.fish)
|
# - Current directory name
|
||||||
|
# - ─╼
|
||||||
function _ruby_version
|
# Right prompt:
|
||||||
echo (command rbenv version-name | sed 's/\n//')
|
# - Exit code of the previous command
|
||||||
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 last_status $status
|
||||||
set -l red (set_color red)
|
set_color $fish_color_cwd
|
||||||
set -l normal (set_color normal)
|
printf $last_status
|
||||||
set ruby_info $red(_ruby_version)
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
if [ "$theme_display_rbenv_with_gemfile_only" = 'yes' ]
|
|
||||||
if test -f Gemfile
|
|
||||||
echo -n -s $ruby_info $normal
|
|
||||||
else
|
|
||||||
echo -n -s $normal
|
|
||||||
end
|
|
||||||
else
|
|
||||||
echo -n -s $ruby_info $normal
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user