Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a new dotfiles module to sugar with gm cfg commands #177

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

amtoine
Copy link
Owner

@amtoine amtoine commented Jan 31, 2024

this needs an addition in the external completer...

@amtoine amtoine added sugar Related to the `nu-git-manager-sugar` module new-command Adds a new command labels Jan 31, 2024
@amtoine
Copy link
Owner Author

amtoine commented Feb 6, 2024

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 carapace-sh/carapace-bin#2210

@amtoine amtoine marked this pull request as ready for review February 6, 2024 16:10
@amtoine amtoine merged commit 0e2538f into main Feb 6, 2024
5 checks passed
@amtoine amtoine deleted the dotfiles-sugar branch February 6, 2024 16:11
amtoine added a commit to amtoine/dotfiles that referenced this pull request Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-command Adds a new command sugar Related to the `nu-git-manager-sugar` module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant