updated nushell zoxide.nu to support overlay use over source #985
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This update changes the
zoxide.nu
template by switching from using thesource
command tooverlay use
. The new approach offers a more flexible and manageable way to load command definitions in Nushell.Why Switch to
overlay use
?Scope:
source
: Loads definitions directly into your global session, making them always active.overlay use
: Loads definitions into a separate overlay (a distinct layer) that you can easily toggle on or off as needed.Management:
source
: Once loaded, definitions stick around for the entire session until explicitly changed.overlay use
: Overlays give you more control – you can list, hide, reload, or rename them. This means you can decide exactly which sets of definitions are active at any time.Use Cases:
source
: Great for quickly running a script and having everything immediately available.overlay use
: Perfect for a modular setup where you want the ability to add or remove groups of commands without cluttering your global environment.Conclusion
By moving to
overlay use
, this update makes your Nushell experience cleaner and more organized. It offers a more modular and reversible way to manage your environment, giving you fine-grained control over your commands and settings.Feel free to review the changes and let me know if you have any feedback. Thanks!