mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2025-06-13 13:03:54 +00:00
Merge 02c7be204f
into 12b829e0bf
This commit is contained in:
commit
dee4172d7d
@ -85,7 +85,7 @@ set -g theme_display_hg yes
|
|||||||
set -g theme_display_virtualenv no
|
set -g theme_display_virtualenv no
|
||||||
set -g theme_display_nix no
|
set -g theme_display_nix no
|
||||||
set -g theme_display_ruby no
|
set -g theme_display_ruby no
|
||||||
set -g theme_display_nvm yes
|
set -g theme_display_nodejs yes
|
||||||
set -g theme_display_user ssh
|
set -g theme_display_user ssh
|
||||||
set -g theme_display_hostname ssh
|
set -g theme_display_hostname ssh
|
||||||
set -g theme_display_vi no
|
set -g theme_display_vi no
|
||||||
@ -124,7 +124,7 @@ set -g theme_newline_prompt '$ '
|
|||||||
**Prompt options**
|
**Prompt options**
|
||||||
|
|
||||||
- `theme_display_ruby`. Use `no` to completely hide all information about Ruby version. By default Ruby version displayed if there is the difference from default settings.
|
- `theme_display_ruby`. Use `no` to completely hide all information about Ruby version. By default Ruby version displayed if there is the difference from default settings.
|
||||||
- `theme_display_nvm`. If set to `yes`, will display current NVM node version.
|
- `theme_display_nodejs`. If set to `yes`, will display current Node.js version.
|
||||||
- `theme_display_vagrant`. This feature is disabled by default, use `yes` to display Vagrant status in your prompt. Please note that only the VirtualBox and VMWare providers are supported.
|
- `theme_display_vagrant`. This feature is disabled by default, use `yes` to display Vagrant status in your prompt. Please note that only the VirtualBox and VMWare providers are supported.
|
||||||
- `theme_display_vi`. By default the vi mode indicator will be shown if vi or hybrid key bindings are enabled. Use `no` to hide the indicator, or `yes` to show the indicator.
|
- `theme_display_vi`. By default the vi mode indicator will be shown if vi or hybrid key bindings are enabled. Use `no` to hide the indicator, or `yes` to show the indicator.
|
||||||
- `theme_display_k8s_context`. This feature is disabled by default. Use `yes` to show the current kubernetes context (`> kubectl config current-context`).
|
- `theme_display_k8s_context`. This feature is disabled by default. Use `yes` to show the current kubernetes context (`> kubectl config current-context`).
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
# set -g theme_display_hostname ssh
|
# set -g theme_display_hostname ssh
|
||||||
# set -g theme_display_sudo_user yes
|
# set -g theme_display_sudo_user yes
|
||||||
# set -g theme_display_vi no
|
# set -g theme_display_vi no
|
||||||
# set -g theme_display_nvm yes
|
# set -g theme_display_nodejs yes
|
||||||
# set -g theme_avoid_ambiguous_glyphs yes
|
# set -g theme_avoid_ambiguous_glyphs yes
|
||||||
# set -g theme_powerline_fonts no
|
# set -g theme_powerline_fonts no
|
||||||
# set -g theme_nerd_fonts yes
|
# set -g theme_nerd_fonts yes
|
||||||
@ -895,14 +895,35 @@ function __bobthefish_prompt_desk -S -d 'Display current desk environment'
|
|||||||
set_color normal
|
set_color normal
|
||||||
end
|
end
|
||||||
|
|
||||||
function __bobthefish_prompt_nvm -S -d 'Display current node version through NVM'
|
function __bobthefish_prompt_nodejs -S -d 'Display current Node.js version'
|
||||||
[ "$theme_display_nvm" = 'yes' -a -n "$NVM_DIR" ]
|
[ "$theme_display_nodejs" = 'yes' -o "$theme_display_nvm" = 'yes' ]
|
||||||
or return
|
or return
|
||||||
|
|
||||||
set -l node_version (nvm current 2> /dev/null)
|
set -l node_version
|
||||||
|
if type -q nvm
|
||||||
|
[ -n "$NVM_DIR" ]
|
||||||
|
or return
|
||||||
|
|
||||||
[ -z $node_version -o "$node_version" = 'none' -o "$node_version" = 'system' ]
|
set node_version (nvm current 2> /dev/null)
|
||||||
and return
|
|
||||||
|
[ -z $node_version -o "$node_version" = 'none' -o "$node_version" = 'system' ]
|
||||||
|
and return
|
||||||
|
else if type -fq nodenv
|
||||||
|
set node_version (nodenv version-name)
|
||||||
|
|
||||||
|
# Don't show global node version...
|
||||||
|
set -q NODENV_ROOT
|
||||||
|
or set -l NODENV_ROOT $HOME/.nodenv
|
||||||
|
|
||||||
|
[ -e "$NODENV_ROOT/version" ]
|
||||||
|
and read -l global_node_version < "$NODENV_ROOT/version"
|
||||||
|
|
||||||
|
[ "$global_node_version" ]
|
||||||
|
or set -l global_node_version system
|
||||||
|
|
||||||
|
[ "$node_version" = "$global_node_version" ]
|
||||||
|
and return
|
||||||
|
end
|
||||||
|
|
||||||
__bobthefish_start_segment $color_nvm
|
__bobthefish_start_segment $color_nvm
|
||||||
echo -ns $node_glyph $node_version ' '
|
echo -ns $node_glyph $node_version ' '
|
||||||
@ -1124,7 +1145,7 @@ function fish_prompt -d 'bobthefish, a fish theme optimized for awesome'
|
|||||||
__bobthefish_prompt_rubies
|
__bobthefish_prompt_rubies
|
||||||
__bobthefish_prompt_virtualfish
|
__bobthefish_prompt_virtualfish
|
||||||
__bobthefish_prompt_virtualgo
|
__bobthefish_prompt_virtualgo
|
||||||
__bobthefish_prompt_nvm
|
__bobthefish_prompt_nodejs
|
||||||
|
|
||||||
set -l real_pwd (__bobthefish_pwd)
|
set -l real_pwd (__bobthefish_pwd)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user