snowflake/home/nushell/env.nu

42 lines
1.1 KiB
Text
Raw Normal View History

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 = ([
(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 = {|| "::: " }
2023-01-30 11:32:07 -05:00
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')
2023-04-15 21:43:07 -04:00
]