# Default Nushell Environment Config File # These "sensible defaults" are set before the user's `env.nu` is loaded # # version = "0.100.1" $env.PROMPT_COMMAND = $env.PROMPT_COMMAND? | default {|| let dir = match (do -i { $env.PWD | path relative-to $nu.home-path }) { null => $env.PWD '' => '~' $relative_pwd => ([~ $relative_pwd] | path join) } let path_color = (if (is-admin) { ansi red_bold } else { ansi green_bold }) let separator_color = (if (is-admin) { ansi light_red_bold } else { ansi light_green_bold }) let path_segment = $"($path_color)($dir)(ansi reset)" $path_segment | str replace --all (char path_sep) $"($separator_color)(char path_sep)($path_color)" } $env.PROMPT_INDICATOR = $env.PROMPT_INDICATOR? | default "> " $env.PROMPT_INDICATOR_VI_NORMAL = $env.PROMPT_INDICATOR_VI_NORMAL? | default "> " $env.PROMPT_INDICATOR_VI_INSERT = $env.PROMPT_INDICATOR_VI_INSERT? | default ": " $env.PROMPT_MULTILINE_INDICATOR = $env.PROMPT_MULTILINE_INDICATOR? | default "::: " $env.PROMPT_COMMAND_RIGHT = $env.PROMPT_COMMAND_RIGHT? | default {|| # create a right prompt in magenta with green separators and am/pm underlined let time_segment = ([ (ansi reset) (ansi magenta) (date now | format date '%x %X') # try to respect user's locale ] | str join | str replace --regex --all "([/:])" $"(ansi green)${1}(ansi magenta)" | str replace --regex --all "([AP]M)" $"(ansi magenta_underline)${1}") let last_exit_code = if ($env.LAST_EXIT_CODE != 0) {([ (ansi rb) ($env.LAST_EXIT_CODE) ] | str join) } else { "" } ([$last_exit_code, (char space), $time_segment] | str join) } $env.ENV_CONVERSIONS = { "PATH": { from_string: { |s| $s | split row (char esep) | path expand --no-symlink } to_string: { |v| $v | path expand --no-symlink | str join (char esep) } } } $env.NU_LIB_DIRS = $env.NU_LIB_DIRS? | default [ ($nu.default-config-dir | path join 'scripts') # add /scripts ($nu.data-dir | path join 'completions') # default home for nushell completions ] $env.NU_PLUGIN_DIRS = $env.NU_PLUGIN_DIRS | default [ ($nu.default-config-dir | path join 'plugins') # add /plugins ]