nushell: add config.nu, env.nu, starship

This commit is contained in:
Charlie Root 2024-09-16 21:01:10 +02:00
commit 2883e717df
5 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,16 @@
let starship_installed = not (which starship | is-empty)
$env.config = {
show_banner: false
}
if $starship_installed {
$env.STARSHIP_SHELL = "nu"
$env.STARSHIP_SESSION_KEY = (random chars -l 16)
$env.STARSHIP_SESSION_KEY = (random chars -l 16)
$env.PROMPT_MULTILINE_INDICATOR = (starship prompt --continuation)
# $env.PROMPT_INDICATOR = "$ "
$env.PROMPT_COMMAND = {|| starship prompt $"--cmd-duration=($env.CMD_DURATION_MS)" $"--status=($env.LAST_EXIT_CODE)" }
$env.PROMPT_COMMAND_RIGHT = ''
} else {}