From 572376a0703d14f3899235055ad6bf1c60218091 Mon Sep 17 00:00:00 2001 From: upidapi Date: Sun, 17 Nov 2024 21:32:27 +0100 Subject: [PATCH] improve the example carapace completer --- .../src/sample_config/default_config.nu | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/nu-utils/src/sample_config/default_config.nu b/crates/nu-utils/src/sample_config/default_config.nu index c8b398b684..dbfc2ce719 100644 --- a/crates/nu-utils/src/sample_config/default_config.nu +++ b/crates/nu-utils/src/sample_config/default_config.nu @@ -142,7 +142,22 @@ let light_theme = { # External completer example # let carapace_completer = {|spans| -# carapace $spans.0 nushell ...$spans | from json +# # carapace doesn't give completions if you don't give it any additional +# # args +# mut spans = $spans +# if ($spans | is-empty) { +# $spans = [""] +# } +# +# carapace $spans.0 nushell ...$spans | from json +# # sort by color +# | sort-by { +# let fg = $in | get -i style.fg +# let attr = $in | get -i style.attr +# +# # the ~ there to make "empty" results appear at the end +# $"($fg)~($attr)" +# } # } # The default config record. This is where much of your global configuration is setup.