Skip to content

Provide completions for Nushell #1064

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ysthakur
Copy link

This PR provides completions for z and zi. Nushell no longer uses external completers for internal commands since v0.103 (release notes), so people's old external Zoxide completers won't work anymore.

This completer uses the option completion_algorithm: "substring", which was only added in 0.104. An alternative would be to use completion_algorithm: "prefix", positional: false, which works in older versions but is deprecated.

This completer also looks a little weird if you type in multiple arguments. If you type in z /foo bar<TAB>, all the completions you see will have everything up to and including the first /foo stripped. It's not great, but it's needed because custom completers in Nushell can't currently choose which span they want to replace. Without it, if your first result upon typing z /foo bar<TAB> were /foo/bar, hitting Enter would replace your command line with z /foo /foo/bar, which is incorrect.

asciicast

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.

1 participant