mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-11 00:00:06 +00:00
Merging @dritter's Node.js segment support.
This is PR #53. Merge remote-tracking branch 'dritter/dritter/nvm'
This commit is contained in:
commit
6144225330
2 changed files with 10 additions and 0 deletions
|
@ -224,6 +224,7 @@ currently available are:
|
|||
* **context** - Your username and host (more info below)
|
||||
* **dir** - Your current working directory.
|
||||
* **history** - The command number for the current line.
|
||||
* **node_version** - Show the version number of the installed Node.js.
|
||||
* **rbenv** - Ruby environment information (if one is active).
|
||||
* **rspec_stats** - Show a ratio of test classes vs code classes for RSpec.
|
||||
* **status** - The return code of the previous command, and status of background jobs.
|
||||
|
|
|
@ -472,6 +472,15 @@ prompt_longstatus() {
|
|||
[[ -n "$symbols" ]] && $1_prompt_segment "$0" "$bg" "$DEFAULT_COLOR" "$symbols"
|
||||
}
|
||||
|
||||
# Node version
|
||||
prompt_node_version() {
|
||||
local nvm_prompt=$(node -v 2>/dev/null)
|
||||
[[ -z "${nvm_prompt}" ]] && return
|
||||
NODE_ICON=$'\u2B22 ' # ⬢
|
||||
|
||||
$1_prompt_segment "$0" "green" "white" "${nvm_prompt:1} $NODE_ICON"
|
||||
}
|
||||
|
||||
# rbenv information
|
||||
prompt_rbenv() {
|
||||
if [[ -n "$RBENV_VERSION" ]]; then
|
||||
|
|
Loading…
Reference in a new issue