147 lines
6.2 KiB
Nu
147 lines
6.2 KiB
Nu
$env.config.show_banner = false
|
|
$env.config.completions.case_sensitive = false
|
|
$env.config.completions.algorithm = "fuzzy"
|
|
$env.config.completions.quick = true
|
|
$env.config.completions.partial = true
|
|
|
|
$env.config.table.mode = 'dots'
|
|
|
|
source $"($nu.cache-dir)/carapace.nu"
|
|
use $"($nu.cache-dir)/starship.nu"
|
|
|
|
# direnv hook
|
|
$env.config = ($env.config? | default {})
|
|
$env.config.hooks = ($env.config.hooks? | default {})
|
|
$env.config.hooks.pre_prompt = (
|
|
$env.config.hooks.pre_prompt?
|
|
| default []
|
|
| append {||
|
|
direnv export json
|
|
| from json --strict
|
|
| default {}
|
|
| items {|key, value|
|
|
let value = do (
|
|
{
|
|
"PATH": {
|
|
from_string: {|s| $s | split row (char esep) | path expand --no-symlink }
|
|
to_string: {|v| $v | path expand --no-symlink | str join (char esep) }
|
|
}
|
|
}
|
|
| merge ($env.ENV_CONVERSIONS? | default {})
|
|
| get ([[value, optional, insensitive]; [$key, true, true] [from_string, true, false]] | into cell-path)
|
|
| if ($in | is-empty) { {|x| $x} } else { $in }
|
|
) $value
|
|
return [ $key $value ]
|
|
}
|
|
| into record
|
|
| load-env
|
|
}
|
|
)
|
|
|
|
source ($nu.default-config-dir | path join "zoxide.nu")
|
|
|
|
# ──────────────────────────────────────────────────────
|
|
# Kanagawa Theme for Nushell
|
|
# Based on: https://www.ssp.sh/brain/kanagawa/
|
|
# Docs: https://www.nushell.sh/book/coloring_and_theming.html
|
|
# ──────────────────────────────────────────────────────
|
|
|
|
# --- Kanagawa palette ---
|
|
let fujiWhite = "#DCD7BA" # Default foreground
|
|
let oldWhite = "#C8C093" # Dark foreground (statuslines)
|
|
let sumiInk0 = "#16161D" # Dark background
|
|
let sumiInk1 = "#1F1F28" # Default background
|
|
let sumiInk2 = "#2A2A37" # Lighter background
|
|
let sumiInk3 = "#363646" # Cursorline background
|
|
let sumiInk4 = "#54546D" # Darker foreground / borders
|
|
let waveBlue1 = "#223249" # Popup background
|
|
let waveBlue2 = "#2D4F67" # Popup selection background
|
|
let winterGreen = "#2B3328" # Diff Add (bg)
|
|
let winterYellow = "#49443C" # Diff Change (bg)
|
|
let winterRed = "#43242B" # Diff Delete (bg)
|
|
let winterBlue = "#252535" # Diff Change alt (bg)
|
|
let autumnGreen = "#76946A" # Diff Add (fg)
|
|
let autumnRed = "#C34043" # Diff Delete (fg)
|
|
let autumnYellow = "#DCA561" # Diff Change (fg)
|
|
let samuraiRed = "#E82424" # Error
|
|
let roninYellow = "#FF9E3B" # Warning
|
|
let waveAqua1 = "#6A9589" # Info
|
|
let dragonBlue = "#658594" # Hint
|
|
let crystalBlue = "#7E9CD8" # Functions
|
|
let springBlue = "#7FB4CA" # Specials / builtin functions
|
|
let waveAqua2 = "#7AA89F" # Types
|
|
let springGreen = "#98BB6C" # Strings
|
|
let boatYellow2 = "#C0A36E" # Operators, RegEx
|
|
let carpYellow = "#E6C384" # Identifiers
|
|
let sakuraPink = "#D27E99" # Numbers
|
|
let waveRed = "#E46876" # Builtin variables
|
|
let peachRed = "#FF5D62" # Exceptions, return
|
|
let surimiOrange = "#FFA066" # Constants, booleans
|
|
let oniViolet = "#957FB8" # Keywords, statements
|
|
let katanaGray = "#717C7C" # Deprecated / dimmed
|
|
|
|
# --- Build the color_config record ---
|
|
let kanagawa_theme = {
|
|
# ── Table & UI ──
|
|
separator: $sumiInk4
|
|
leading_trailing_space_bg: $sumiInk2
|
|
header: $springBlue
|
|
datetime: $carpYellow
|
|
filesize: $springBlue
|
|
row_index: $carpYellow
|
|
hints: $katanaGray
|
|
|
|
# ── Data types ──
|
|
bool: $surimiOrange
|
|
int: $sakuraPink
|
|
float: $sakuraPink
|
|
duration: $waveAqua2
|
|
range: $waveAqua2
|
|
string: $springGreen
|
|
nothing: $waveAqua1
|
|
binary: $dragonBlue
|
|
cell-path: $waveAqua1
|
|
|
|
# ── Syntax shapes ──
|
|
shape_garbage: { fg: "#FFFFFF" bg: $samuraiRed attr: b }
|
|
shape_bool: $surimiOrange
|
|
shape_int: $sakuraPink
|
|
shape_float: $sakuraPink
|
|
shape_range: $waveAqua2
|
|
shape_binary: $dragonBlue
|
|
shape_internalcall: $crystalBlue
|
|
shape_external: $springBlue
|
|
shape_externalarg: $springGreen
|
|
shape_literal: $oniViolet
|
|
shape_operator: $boatYellow2
|
|
shape_signature: $crystalBlue
|
|
shape_string: $springGreen
|
|
shape_string_interpolation: $waveAqua2
|
|
shape_datetime: $carpYellow
|
|
shape_directory: $springBlue
|
|
shape_filepath: $springBlue
|
|
shape_globpattern: $boatYellow2
|
|
shape_variable: $waveRed
|
|
shape_vardecl: $carpYellow
|
|
shape_block: $oniViolet
|
|
shape_record: $oniViolet
|
|
shape_list: $oniViolet
|
|
shape_table: $oniViolet
|
|
shape_custom: $springGreen
|
|
shape_redirection: $boatYellow2
|
|
shape_nothing: $waveAqua1
|
|
shape_raw_string: $springGreen
|
|
shape_flag: $surimiOrange
|
|
|
|
# ── Errors / status ──
|
|
shape_error: $samuraiRed
|
|
shape_warning: $roninYellow
|
|
}
|
|
|
|
# ── Apply the theme ──
|
|
$env.config.color_config = $kanagawa_theme
|
|
|
|
# ── LS_COLORS (optional, using Kanagawa-inspired values) ──
|
|
# Replace with `vivid generate <theme>` if you prefer a curated set
|
|
$env.LS_COLORS = "di=38;2;126;156;216:fi=38;2;220;215;186:ln=38;2;126;180;216:pi=38;2;106;149;137:so=38;2;255;158;59:bd=38;2;232;36;36:cd=38;2;255;93;98:or=38;2;195;127;184:ex=38;2;152;187;108:*.tar=38;2;192;163;110:*.zip=38;2;192;163;110:*.gz=38;2;192;163;110:*.rs=38;2;126;156;216:*.nu=38;2;126;156;216:*.toml=38;2;192;163;110:*.json=38;2;192;163;110:*.md=38;2;152;187;108"
|