marc2332 / nu-minimal-prompt

Minimal prompt for Nushell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nu-minimal-prompt

minimal prompt for Nushell

paste this in your config.nu:

$env.PROMPT_COMMAND = { ||
    let cwd = $env.PWD | path basename 
    let name = $env.USERNAME
    let branch = do { git branch --show-current } | complete
    let git_status = if $branch.exit_code == 0 and $branch.stdout != "" {
        $"(ansi white) ➜(ansi yellow) \u{eafe} ($branch.stdout)"
    } else {
        "\n"
    }
    $"(ansi magenta)($name) (ansi white)➜ (ansi blue)($cwd)($git_status)\n"
}

$env.PROMPT_COMMAND_RIGHT = { ||
    ""
}

About

Minimal prompt for Nushell