mirror of
https://github.com/nushell/nushell.git
synced 2024-12-25 16:39:08 +01:00
add examples for adding paths to PATH, and to load from a custom file in default_env.nu
(#12032)
# Description Show an example of loading from a custom file, and an example of adding multiple entry to PATH. Loading from a custom file will hopefully allow for greater modularity of configuration files out of the box for new users. Adding multiple paths to PATH is very common, and will help new users to. Adds this: ``` # To add multiple paths to PATH this may be simpler: # use std "path add" # $env.PATH = ($env.PATH | split row (char esep)) # path add /some/path # path add ($env.CARGO_HOME | path join "bin") # path add ($env.HOME | path join ".local" "bin") # $env.PATH = ($env.PATH | uniq) # To load from a custom file you can use: # source ($nu.default-config-dir | path join 'custom.nu') ``` --------- Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
parent
626d597527
commit
9a9fdd7a35
@ -87,3 +87,14 @@ $env.NU_PLUGIN_DIRS = [
|
||||
|
||||
# To add entries to PATH (on Windows you might use Path), you can use the following pattern:
|
||||
# $env.PATH = ($env.PATH | split row (char esep) | prepend '/some/path')
|
||||
# An alternate way to add entries to $env.PATH is to use the custom command `path add`
|
||||
# which is built into the nushell stdlib:
|
||||
# use std "path add"
|
||||
# $env.PATH = ($env.PATH | split row (char esep))
|
||||
# path add /some/path
|
||||
# path add ($env.CARGO_HOME | path join "bin")
|
||||
# path add ($env.HOME | path join ".local" "bin")
|
||||
# $env.PATH = ($env.PATH | uniq)
|
||||
|
||||
# To load from a custom file you can use:
|
||||
# source ($nu.default-config-dir | path join 'custom.nu')
|
||||
|
Loading…
Reference in New Issue
Block a user