Add FNM as an alternative to NVM

pull/292/head
wesbaker 4 years ago
parent 12b829e0bf
commit 9a17a11e09

@ -47,7 +47,7 @@ This theme is based loosely on [agnoster][agnoster].
* Current RVM, rbenv or chruby (Ruby) version
* Current virtualenv (Python) version
* _If you use virtualenv, you will probably need to disable the default virtualenv prompt, since it doesn't play nice with fish: `set -x VIRTUAL_ENV_DISABLE_PROMPT 1`_
* Current NVM version (Nodejs) (inactive by default; see configurations in the next paragraph)
* Current NVM/FNM version (Nodejs) (inactive by default; see configurations in the next paragraph)
* Abbreviated parent directory
* Current directory, or Git or Mercurial project name
* Current project's repo branch (<img width="16" alt="branch-glyph" src="https://cloud.githubusercontent.com/assets/53660/8768360/53ee9b58-2e32-11e5-9977-cee0063936fa.png"> master) or detached head (`➦` d0dfd9b)
@ -86,6 +86,7 @@ set -g theme_display_virtualenv no
set -g theme_display_nix no
set -g theme_display_ruby no
set -g theme_display_nvm yes
set -g theme_display_fnm yes
set -g theme_display_user ssh
set -g theme_display_hostname ssh
set -g theme_display_vi no
@ -125,6 +126,7 @@ set -g theme_newline_prompt '$ '
- `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_fnm`. If set to `yes`, will display current FNM node 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_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`).

@ -40,6 +40,7 @@
# set -g theme_display_sudo_user yes
# set -g theme_display_vi no
# set -g theme_display_nvm yes
# set -g theme_display_fvm yes
# set -g theme_avoid_ambiguous_glyphs yes
# set -g theme_powerline_fonts no
# set -g theme_nerd_fonts yes
@ -909,6 +910,20 @@ function __bobthefish_prompt_nvm -S -d 'Display current node version through NVM
set_color normal
end
function __bobthefish_prompt_nvm -S -d 'Display current node version through FNM'
[ "$theme_display_nvm" = 'yes' -a -n "$FNM_DIR" ]
or return
set -l node_version (fnm current 2> /dev/null)
[ -z $node_version -o "$node_version" = 'none' -o "$node_version" = 'system' ]
and return
__bobthefish_start_segment $color_nvm
echo -ns $node_glyph $node_version ' '
set_color normal
end
function __bobthefish_prompt_nix -S -d 'Display current nix environment'
[ "$theme_display_nix" = 'no' -o -z "$IN_NIX_SHELL" ]
and return

Loading…
Cancel
Save