def create_left_prompt [] { let path_segment = if (is-admin) { $"(ansi red_bold)($env.PWD)" } else { $"(ansi green_bold)($env.PWD)" } $path_segment } def create_right_prompt [] { let time_segment = ([ (date now | date format '%m/%d/%Y %r') ] | str join) $time_segment } let-env PROMPT_COMMAND = {|| create_left_prompt } let-env PROMPT_COMMAND_RIGHT = {|| create_right_prompt } let-env PROMPT_INDICATOR = {|| "〉" } let-env PROMPT_INDICATOR_VI_INSERT = {|| ": " } let-env PROMPT_INDICATOR_VI_NORMAL = {|| "〉" } let-env PROMPT_MULTILINE_INDICATOR = {|| "::: " } let-env ENV_CONVERSIONS = { "PATH": { from_string: { |s| $s | split row (char esep) | path expand -n } to_string: { |v| $v | path expand -n | str join (char esep) } } "Path": { from_string: { |s| $s | split row (char esep) | path expand -n } to_string: { |v| $v | path expand -n | str join (char esep) } } } let-env NU_LIB_DIRS = [ ($nu.config-path | path dirname | path join 'scripts') ] let-env NU_PLUGIN_DIRS = [ ($nu.config-path | path dirname | path join 'plugins') ] starship init nu | str replace --string 'PROMPT_COMMAND = {' 'PROMPT_COMMAND = { ||' | str replace --string 'PROMPT_COMMAND_RIGHT = {' 'PROMPT_COMMAND_RIGHT = { ||' | save -f ~/.cache/starship/init.nu