From 0575e6d78df26812cd2fa2571ac4cfa8e7dc6180 Mon Sep 17 00:00:00 2001 From: "L. Yeung" Date: Mon, 8 Aug 2022 00:29:54 +0800 Subject: [PATCH] docs(nushell): revise descriptions about init --- website/docs/installation/customize.mdx | 17 ++++++++++++++--- website/docs/installation/prompt.mdx | 17 ++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/website/docs/installation/customize.mdx b/website/docs/installation/customize.mdx index 71bf91fe..fa184701 100644 --- a/website/docs/installation/customize.mdx +++ b/website/docs/installation/customize.mdx @@ -139,21 +139,32 @@ Once altered, reload your config for the changes to take effect. Oh My Posh requires Nushell >= 0.60.0 ::: -Edit `$nu.configuration/path` and add the following lines at the bottom. +Run the following command: ```bash oh-my-posh init nu --config ~/.jandedobbeleer.omp.json +``` + +it saves the initialization script to `~/.oh-my-posh.nu` by default. +Then edit the Nushell config file (`$nu.config-path`) and add the following line at the bottom: + +```bash source ~/.oh-my-posh.nu ``` -If you want to save the initialization script elsewhere, replace the lines above with these: +If you want to save the initialization script elsewhere, you should run a command like: ```bash oh-my-posh init nu --config ~/.jandedobbeleer.omp.json --print | save /mylocation/myscript.nu +``` + +and add the `source` line like: + +```bash source /mylocation/myscript.nu ``` -Once altered, restart nu shell for the changes to take effect. +Once altered, restart Nushell for the changes to take effect. diff --git a/website/docs/installation/prompt.mdx b/website/docs/installation/prompt.mdx index cf91ac5a..8264cb49 100644 --- a/website/docs/installation/prompt.mdx +++ b/website/docs/installation/prompt.mdx @@ -160,21 +160,32 @@ exec fish Oh My Posh requires Nushell >= 0.60.0 ::: -Edit `$nu.config-path` and add the following lines at the bottom. +Run the following command: ```bash oh-my-posh init nu +``` + +it saves the initialization script to `~/.oh-my-posh.nu` by default. +Then edit the Nushell config file (`$nu.config-path`) and add the following line at the bottom: + +```bash source ~/.oh-my-posh.nu ``` -If you want to save the initialization script elsewhere, replace the lines above with these: +If you want to save the initialization script elsewhere, you should run a command like: ```bash oh-my-posh init nu --print | save /mylocation/myscript.nu +``` + +and add the `source` line like: + +```bash source /mylocation/myscript.nu ``` -Restart Nushell for the changes to take effect. +Once added, restart Nushell for the changes to take effect.