config dump

This commit is contained in:
Bloxx12 2025-07-17 00:55:24 +02:00
commit cf8afe544a
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E
6 changed files with 355 additions and 357 deletions

View file

@ -1,46 +1,30 @@
$env.config.completions = {
algorithm: prefix
sort: smart
case_sensitive: false
quick: true
partial: true
use_ls_colors: true
external: {
enable: true
max_results: 10
completer: {|spans: list<string>|
# if the current command is an alias, get it's expansion
let expanded_alias = (scope aliases | where name == $spans.0 | get -i 0 | get -i expansion)
$env.PATH = ($env.PATH | split row (char esep) | prepend "/home/cr/.config/carapace/bin")
# overwrite
let spans = (if $expanded_alias != null {
# put the first word of the expanded alias first in the span
$spans | skip 1 | prepend ($expanded_alias | split row " " | take 1)
} else {
$spans | skip 1 | prepend ($spans.0)
})
def --env get-env [name] { $env | get $name }
def --env set-env [name, value] { load-env { $name: $value } }
def --env unset-env [name] { hide-env $name }
carapace $spans.0 nushell ...$spans
| from json
}
}
let carapace_completer = {|spans|
# if the current command is an alias, get it's expansion
let expanded_alias = (scope aliases | where name == $spans.0 | get -i 0 | get -i expansion)
# overwrite
let spans = (if $expanded_alias != null {
# put the first word of the expanded alias first in the span
$spans | skip 1 | prepend ($expanded_alias | split row " " | take 1)
} else {
$spans | skip 1 | prepend ($spans.0)
})
carapace $spans.0 nushell ...$spans
| from json
}
$env.config.menus ++= [
{
marker: $"(ansi yellow)┣ "
name: completion_menu
only_buffer_difference: false
style: {
description_text: yellow
selected_text: red_reverse
text: yellow
}
type: {
col_padding: 2
col_width: 20
columns: 1
layout: columnar
}
}
]
mut current = (($env | default {} config).config | default {} completions)
$current.completions = ($current.completions | default {} external)
$current.completions.external = ($current.completions.external
| default true enable
| default { $carapace_completer } completer)
$env.config = $current