-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node/nvm version behavior (only show when a package.json file is present and use the nvm version) #373
Comments
At the top of # The list of segments shown on the right.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
...
nodenv # node.js version from nodenv (https://github.com/nodenv/nodenv)
nvm # node.js version from nvm (https://github.com/nvm-sh/nvm)
nodeenv # node.js environment (https://github.com/ekalinin/nodeenv)
# node_version # node.js version
...
) There are several prompt segments that refer to node.js version. The last segment -- Below this, there is one section for each prompt segment that defines parameters specifically for that segment. For example, here's what the config has for ####################[ node_version: node.js version ]#####################
# Show node version only when in a directory tree containing package.json.
typeset -g POWERLEVEL9K_NODE_VERSION_PROJECT_ONLY=true
...
You can achieve the desired behavior by uncommenting
Thanks 🤗 |
This worked exactly like you said! Thanks 🙏 |
Thanks for the confirmation. |
I'm unsure if this is possible since there are multiple node settings. I've attached a gif.
In that
node-starter
directory there is apackage.json
file and it doesn't show the node version initially which I would expect since in the config this setting is set:However, only after I use
nvm use
(since there is an.nvmrc) does it show the node version, and when I do an
nvm use defaultit goes back to not showing it again. Also if I do an
nvm useand then navigate out of that directory to a directory that doesn't have a
package.json` file it still shows the node version.What behavior I would like to happen:
It always, but only, shows the node version when the directory has a
package.json
file. If the directory does not have apackage.json
file then don't show any node information.Thanks for this awesome theme!
The text was updated successfully, but these errors were encountered: