From 32c6f3a6b2efc888c4f2774eba4825b9ce516b4c Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Tue, 10 Feb 2026 13:00:38 -0800 Subject: [PATCH] git-completion: complete aliases, too! --- custom-completions/git/git-completions.nu | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/custom-completions/git/git-completions.nu b/custom-completions/git/git-completions.nu index 0beccc8e..15566a5f 100644 --- a/custom-completions/git/git-completions.nu +++ b/custom-completions/git/git-completions.nu @@ -274,8 +274,16 @@ def "nu-complete git files-or-refs" [] { | append (nu-complete git built-in-refs) } +def "nu-complete git aliases" [] { + ^git config --get-regexp ^alias\. + | lines + | parse "alias.{value} {description}" +} + def "nu-complete git subcommands" [] { ^git help -a | lines | where $it starts-with " " | parse -r '\s*(?P[^ ]+) \s*(?P\w.*)' + | append (nu-complete git aliases) + | uniq-by value } def "nu-complete git add" [] {