2023-01-30 11:32:07 -05:00
|
|
|
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 = ([
|
2023-10-29 05:30:35 -04:00
|
|
|
(date now | format date '%m/%d/%Y %r')
|
2023-01-30 11:32:07 -05:00
|
|
|
] | str join)
|
|
|
|
|
|
|
|
$time_segment
|
|
|
|
}
|
|
|
|
|
2023-07-30 14:40:44 -04:00
|
|
|
$env.PROMPT_COMMAND = {|| create_left_prompt }
|
|
|
|
$env.PROMPT_COMMAND_RIGHT = {|| create_right_prompt }
|
|
|
|
$env.PROMPT_INDICATOR = {|| "〉" }
|
|
|
|
$env.PROMPT_INDICATOR_VI_INSERT = {|| ": " }
|
|
|
|
$env.PROMPT_INDICATOR_VI_NORMAL = {|| "〉" }
|
|
|
|
$env.PROMPT_MULTILINE_INDICATOR = {|| "::: " }
|
|
|
|
$env.ENV_CONVERSIONS = {
|
2023-01-30 11:32:07 -05:00
|
|
|
"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) }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-07-30 14:40:44 -04:00
|
|
|
$env.NU_LIB_DIRS = [
|
2023-01-30 11:32:07 -05:00
|
|
|
($nu.config-path | path dirname | path join 'scripts')
|
|
|
|
]
|
|
|
|
|
2023-07-30 14:40:44 -04:00
|
|
|
$env.NU_PLUGIN_DIRS = [
|
2023-01-30 11:32:07 -05:00
|
|
|
($nu.config-path | path dirname | path join 'plugins')
|
2023-10-29 05:30:35 -04:00
|
|
|
]
|