$env.config.buffer_editor = "vim"
$env.PROMPT_COMMAND_RIGHT = ""
$env.path ++= ["~/.local/bin"]
$env.config.show_banner = false
$env.config.table.mode = 'none'
$env.TERM = "xterm"
$env.USER = "coast"

$env.PROMPT_COMMAND = {
    let dir = (pwd | path basename)
    let home_dir = ($dir | str replace "coast" "home")
    $"(ansi reset)0 ($env.USER) ($home_dir) "
}

$env.PROMPT_INDICATOR = ""

let carapace_completer = {|spans|
    carapace $spans.0 nushell ...$spans | from json
}

$env.config = {
    show_banner: false
    completions: {
        case_sensitive: false
        quick: true
        partial: true
        algorithm: "fuzzy"
        external: {
            enable: true
            max_results: 100
            completer: $carapace_completer
        }
    }
}

alias sd = sudo
alias nano = vim
alias suod = sudo
alias sduo = sudo
alias hotp = htop
alias c = clear
alias dir = tree -idA

let bg0 = "#0f0f0f"
let bg1 = "#1a1a1a"
let bg2 = "#2a2a2a"
let bg3 = "#3a3a3a"
let fg0 = "#e0def4"
let fg1 = "#ebbcba"
let red    = "#eb6f92"
let green  = "#eb6f92"
let yellow = "#ea9a97"
let blue   = "#d7827e"
let purple = "#ea9a97"
let aqua   = "#ebbcba"
let orange = "#ea9a97"
let gray   = "#6e6a86"

let dark = {
    separator: $gray,
    leading_trailing_space_bg: $bg1,
    header: $yellow,
    datetime: $blue,
    filesize: $green,
    row_index: $gray,

    bool: $green,
    int: $orange,
    float: $yellow,
    string: $fg1,
    nothing: $gray,
    binary: $red,
    cell-path: $blue,
    hints: $gray,

    shape_garbage: { fg: $fg0 bg: $red attr: b },
    shape_bool: $green,
    shape_int: { fg: $orange attr: b },
    shape_float: { fg: $yellow attr: b },
    shape_range: { fg: $yellow attr: b },
    shape_internalcall: { fg: $aqua attr: b },
    shape_external: $blue,
    shape_externalarg: { fg: $green attr: b },
    shape_literal: $fg1,
    shape_operator: $orange,
    shape_signature: { fg: $yellow attr: b },
    shape_string: $purple,
    shape_filepath: $blue,
    shape_globpattern: { fg: $blue attr: b },
    shape_variable: $aqua,
    shape_flag: { fg: $yellow attr: b },
    shape_custom: { attr: b }
}

$env.config.color_config = $dark
$env.config.use_ansi_coloring = true

source ~/.config/nushell/starship.nu

