File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
home/gabriel/features/cli Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 4747 $env.PROMPT_INDICATOR_VI_NORMAL = {|| "| " }
4848 $env.PROMPT_MULTILINE_INDICATOR = {|| "::: " }
4949
50+ let fish_completer = {|spans|
51+ fish --command $"complete '--do-complete=($spans | str replace --all "'" "\\'" | str join ' ')'"
52+ | from tsv --flexible --noheaders --no-infer
53+ | rename value description
54+ | update value {|row|
55+ let value = $row.value
56+ let need_quote = ['\' ',' '[' ']' '(' ')' ' ' '\t' "'" '"' "`"] | any {$in in $value}
57+ if ($need_quote and ($value | path exists)) {
58+ let expanded_path = if ($value starts-with ~) {$value | path expand --no-symlink} else {$value}
59+ $'"($expanded_path | str replace --all "\"" "\\\"")"'
60+ } else {$value}
61+ }
62+ }
63+
5064 $env.config = {
5165 edit_mode: vi,
5266 show_banner: false,
6175 },
6276 completions: {
6377 algorithm: "fuzzy",
78+ external: {
79+ enable: true,
80+ completer: $fish_completer,
81+ },
6482 },
6583 history: {
6684 sync_on_enter: true,
You can’t perform that action at this time.
0 commit comments