nushell dump

This commit is contained in:
Bloxx12 2025-07-15 21:31:31 +02:00
commit 655dfe3d48
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E
6 changed files with 187 additions and 206 deletions

46
nushell/completions.nu Normal file
View file

@ -0,0 +1,46 @@
$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)
# 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
}
}
]