Modified gitignore
This commit is contained in:
27
.config/nushell/prompt.nu
Normal file
27
.config/nushell/prompt.nu
Normal file
@ -0,0 +1,27 @@
|
||||
def prompt [] {
|
||||
mut home = ""
|
||||
|
||||
try {
|
||||
if $nu.os-info.name == "windows" {
|
||||
$home = $env.USERPROFILE
|
||||
} else {
|
||||
$home = $env.HOME
|
||||
}
|
||||
}
|
||||
|
||||
let dir = ([
|
||||
($env.PWD | str substring 0..($home | str length) | str replace $home "~"),
|
||||
($env.PWD | str substring ($home | str length)..)
|
||||
] | str 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)"
|
||||
|
||||
$path_segment | str replace --all (char path_sep) $"($separator_color)/($path_color)"
|
||||
}
|
||||
|
||||
$env.PROMPT_COMMAND = {|| prompt}
|
||||
$env.PROMPT_COMMAND_RIGHT = ""
|
||||
$env.PROMPT_INDICATOR = " "
|
||||
$env.PROMPT_MULTILINE_INDICATOR = {|| "::: " }
|
Reference in New Issue
Block a user