Skip to content

Add abbreviations - #1275

Merged
fdncred merged 2 commits into
nushell:mainfrom
fnuttens:abbreviations
Sep 27, 2026
Merged

fdncred merged 2 commits into
nushell:mainfrom
fnuttens:abbreviations

Conversation

@fnuttens

Copy link
Copy Markdown
Contributor

Closes #1273

@fnuttens
fnuttens force-pushed the abbreviations branch 3 times, most recently from eb1e540 to 64097b7 Compare August 22, 2026 16:58
@DavSanchez

Copy link
Copy Markdown

Hi @fnuttens ! Do you plan to continue working on this? It would be nice to have the abbreviations here 😃

@fdncred

fdncred commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This PR definitely needs work. Some of the scripts appear to append abbreviations and others just overwrite them entirely.

@fnuttens

fnuttens commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor Author

@DavSanchez I do, yes, it’s just that the last few weeks have been quite busy 🙂

@fdncred oops indeed, this is now fixed!

@fdncred

fdncred commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

have you tested the ones with the exclamation point?

@fnuttens

Copy link
Copy Markdown
Contributor Author

@fdncred yes it works as expected!

@fnuttens
fnuttens marked this pull request as ready for review September 22, 2026 21:28
Comment thread abbreviations/git/git-abbreviations.nu Outdated
}

export def git_main_branch [] {
git remote show origin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

Suggested change
git remote show origin
^git remote show origin

so it calls the external in case someone shadowed this command?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, to be honest this is straight out copied from git aliases 😅
Shouldn’t we keep both implementations exactly the same?

I can totally fix this on both sides if that’s ok with you!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya, we should. I'm just saying that sometimes we want to call ^git, the external, and sometimes we want to call git the custom command/alias/module.

@fdncred
fdncred merged commit 32be8aa into nushell:main Sep 27, 2026
1 check passed
@fdncred

fdncred commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Thanks!

DavSanchez added a commit to DavSanchez/nix-dotfiles that referenced this pull request Sep 27, 2026
Replace the ad-hoc ls-family and curated git abbreviations with the
abbreviation modules recently added to nu_scripts (nushell/nu_scripts#1275),
sourced alongside the existing nu_scripts aliases.

The upstream git set is adopted wholesale: composed abbreviations such as
`gstu` expand to text that still relies on the plain aliases, so the alias
sources stay. Note the abbreviation files spread the existing
$env.config.abbreviations *after* their own keys, which makes nushell error
with column_defined_twice on same-named local overrides -- hence the previous
local git set (and its gcm divergence) is dropped rather than overridden.

Requires a nixpkgs bump whose nu_scripts ships share/nu_scripts/abbreviations/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate aliases as abbreviations

3 participants