nushell dump
This commit is contained in:
parent
25483702ac
commit
655dfe3d48
6 changed files with 187 additions and 206 deletions
46
nushell/completions.nu
Normal file
46
nushell/completions.nu
Normal 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
|
||||
}
|
||||
}
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue