Skip to content

Commit e2ac9f8

Browse files
authored
refactor: switch to fnm
1 parent 5c7428e commit e2ac9f8

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

omz/customization.yaml

+17-1
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,27 @@
1616
custom
1717
context
1818
dir
19-
nvm
19+
fnm
2020
git
2121
cmd_exec_time
2222
)
23+
24+
# fnm: Node version manager
25+
prompt_fnm() {
26+
local fnm_prompt
27+
if type fnm >/dev/null 2>&1; then
28+
fnm_prompt=$(fnm current 2>/dev/null)
29+
[[ "${fnm_prompt}x" == "x" || "${fnm_prompt}" == "system" ]] && return
30+
elif type node >/dev/null 2>&1; then
31+
fnm_prompt="$(node --version)"
32+
else
33+
return
34+
fi
35+
fnm_prompt=${fnm_prompt}
36+
prompt_segment $BULLETTRAIN_NVM_BG $BULLETTRAIN_NVM_FG $BULLETTRAIN_NVM_PREFIX$fnm_prompt
37+
}
2338
39+
# computer uptime
2440
prompt_uptime(){
2541
on=${${${(s: :)"$(uptime)"}[3]}%,}
2642
prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG "[$on]"

0 commit comments

Comments
 (0)