Dotfiles/site-modules/core/files/nushell/scripts/prompt.nu
Ade Attwood dc23131046 feat(nu): setup nushell and start off the config
This is some investigation in to nushell will work. I will be looking to use
this cross platform, as zsh will not work on windows.

Adds some of the core modules so I don't loose my mind having to relearn mussel
memory. The goal of this is to replicate my use of oh-my-zsh, I think this will
take some time, I have sunk years into the zsh config. The aliases will be the
same, the GOPATH project structure will be replicated and the dir hooks will be
implemeted so my PATH gets setup just as I like it.
2024-12-08 10:55:05 +00:00

24 lines
805 B
Text

# All the functions use to create the shell prompt. The prompt is based on the
# oh-my-zsh theme "pygmalion". Its way simpler than the original theme but it
# has all the features I have used over the years.
# Creates the left prompt
#
# The format of the prompt is: username@hostname:current_path
def create_left_prompt [] {
let username = $env.USER
let hostname = $env.HOSTNAME
let formatted_path = $env.PWD
| str replace $env.HOME '~'
| str replace '~/Code/src/' '~s/'
| str replace '~s/github.com' '~gh'
$"(ansi magenta)($username)(ansi light_cyan)@(ansi yellow)($hostname)(ansi red):(ansi light_cyan)($formatted_path)(ansi reset)"
}
export-env {
$env.PROMPT_COMMAND = { create_left_prompt }
$env.PROMPT_INDICATOR = "  "
$env.PROMPT_COMMAND_RIGHT = ""
}