42 lines
No EOL
1.1 KiB
Text
Executable file
42 lines
No EOL
1.1 KiB
Text
Executable file
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
|
|
}
|
|
|
|
$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 = {
|
|
"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) }
|
|
}
|
|
}
|
|
|
|
$env.NU_LIB_DIRS = [
|
|
($nu.config-path | path dirname | path join 'scripts')
|
|
]
|
|
|
|
$env.NU_PLUGIN_DIRS = [
|
|
($nu.config-path | path dirname | path join 'plugins')
|
|
] |