$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 = "#282828"
let bg1 = "#3c3836"
let bg2 = "#504945"
let fg0 = "#fbf1c7"
let fg1 = "#ebdbb2"
let fg2 = "#d5c4a1"

let red    = "#cc241d"
let green  = "#98971a"
let yellow = "#d79921"
let blue   = "#458588"
let purple = "#b16286"
let aqua   = "#689d6a"
let orange = "#d65d0e"
let gray   = "#928374"

let gruvbox_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 = $gruvbox_dark
$env.config.use_ansi_coloring = true
