Closed amtoine closed 6 months ago
i had to apply the following diff to my dotfiles to make the completions work with Carapace
diff --git a/.config/nushell/completion.nu b/.config/nushell/completion.nu
index 8261689..8b8f8ca 100644
--- a/.config/nushell/completion.nu
+++ b/.config/nushell/completion.nu
@@ -12,6 +12,12 @@ $env.config.completions.external.completer = {|tokens: list<string>|
let tokens = if $expanded_alias != null {
$expanded_alias | split row " " | append ($tokens | skip 1)
+ } else if ($tokens.0 | str trim | str replace --all --regex '\s+' ' ') == "gm cfg" {
+ [
+ "git",
+ "--git-dir", $env.DOTFILES_GIT_DIR,
+ "--work-tree", $env.DOTFILES_WORKTREE
+ ] | append ($tokens | skip 1)
} else {
$tokens
}
and it requires Carapace 0.30.1 which has been patched with https://github.com/rsteube/carapace-bin/pull/2210
this needs an addition in the external completer...