Skip to content

Instantly share code, notes, and snippets.

@dvgamerr
Last active July 14, 2025 11:34
Show Gist options
  • Save dvgamerr/d4551ba3cc721ff574c5d071556035df to your computer and use it in GitHub Desktop.
Save dvgamerr/d4551ba3cc721ff574c5d071556035df to your computer and use it in GitHub Desktop.
nushell configures Starship prompt, custom right prompt with time/workspaces, VS Code editor, and Python venv alias.
# config.nu
#
# Installed by:
# version = "0.105.1"
#
mkdir ($nu.data-dir | path join "vendor/autoload")
starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu")
def workspaces [] {
shells | enumerate | each {|item|
if $item.item.active {
$"(ansi green)($item.index) "
} else {
$"(ansi blue)($item.index) "
}
}| str join
}
def create_right_prompt [] {
let time_segment = ([
(date now | format date '%r'),
" ",
(workspaces)
] | str join)
$time_segment
}
$env.config.buffer_editor = "code"
$env.PROMPT_COMMAND_RIGHT = { create_right_prompt }
alias activate = overlay use .venv/Scripts/activate.nu
# env.nu
#
# Installed by:
# version = "0.105.1"
#
fnm env --json | from json | load-env
$env.path ++= [$env.FNM_MULTISHELL_PATH]
$env.path ++= ["~/.local/bin", "C:/Program Files/Git/usr/bin"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment