Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions cookbook/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,35 @@ There are other ways to view these values and variables, however setting up your

### Configure your path and other environment variables

In order to configure your path in nushell you'll need to modify your `PATH` environment variable in your `config.nu` file. Open your `config.nu` file and put an entry in it like `$env.PATH = "path1;path2;path3"` ensuring that you use the proper path separation character, which is different by platform.
In your `env.nu`, you can set up your environment.

Alternately, if you want to append a folder to your `PATH` environment variable you can do that too using the `append` or `prepend` command like this:
To configure environment variables, you use the `$env` variable:

```nu
$env.PATH = ($env.PATH | split row (char esep) | append "some/other/path")
$env.TITLE = 'Nu Test'
$env.VALUE = 123
```

For more detailed instructions, see the documentation about [environment variables](/book/environment.html#setting-environment-variables) and [PATH configuration](/book/configuration.html#path-configuration).
To add paths to the `PATH` environment variable, you can append them:

```nu
$env.PATH ++= ['~/.local/bin']
```

Because you can append a list of paths, you can append multiple at once. You can also use subcommands to construct the paths in line.

```nu
$env.PATH ++= [ '~/.local/bin', ($env.CARGO_HOME | path join "bin") ]
```

Because PATH order makes a difference, you may want to *prepend* your paths instead, so that they take precedence over other executables with the same name:

```
use std/util "path add"
path add '~/.local/bin'
```

For more information, see the documentation about [environment variables](/book/environment.html#setting-environment-variables) and [PATH configuration](/book/configuration.html#path-configuration).

### How to list your environment variables

Expand Down