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

zsh completion #29

Open
joeljk13 opened this issue Jan 25, 2015 · 8 comments
Open

zsh completion #29

joeljk13 opened this issue Jan 25, 2015 · 8 comments

Comments

@joeljk13
Copy link
Member

zsh is known for great completion; we should take advantage of that. I know at least @jeremywrnr and I use zsh.

@joeljk13 joeljk13 self-assigned this Jan 25, 2015
@jeremywrnr
Copy link
Contributor

Agreed! I have never made an autocompletion for a command line tool, but it would be awesome to have.

@joeljk13 joeljk13 removed their assignment Mar 4, 2015
@joeljk13
Copy link
Member Author

joeljk13 commented Mar 7, 2015

I've created a zsh completion script! let me know if it gets things wrong or something - writing zsh completion has a really steep learning curve, so there's probably something wrong somewhere.

Just copy the _bb file to some directory in your $fpath. You can also add a directory to your fpath with fpath=(newdir $fpath).

@jeremywrnr
Copy link
Contributor

Just tested, works great!!!

@jeremywrnr
Copy link
Contributor

I don't even know how one would implement this, but it would be awesome would be to have dynamic secondary completions with the courses. For example, perhaps you could cache the course list after bb is logged in, so you could tab through the courses you are registered for after completing assignments, or grades, or any other command that can take in a course as an additional argument.

However, this would probably involve editing the existing bb code, so it may be more trouble than it is worth.

@joeljk13
Copy link
Member Author

joeljk13 commented Mar 9, 2015

yeah this would be cool. I probably would've implemented this if something had happened with #15. I don't think it would be difficult to implement, though - just save the courses to some file (like ~/.bbcourses or something) when ./bb courses is run, and have the completion script complete from that file (http://stackoverflow.com/questions/17318913/make-zsh-complete-arguments-from-a-file will help there).

@jeremywrnr
Copy link
Contributor

Good point. I think it is worth opening a new issue 'dynamic secondary zsh completion', with this feature in mind. It may take a while for the dynamic completion to happen because of it's dependency on #15 . However, the standard zsh completion works well from my usage, so perhaps this original issue should be closed.

@joeljk13
Copy link
Member Author

Not sure whether it's worth opening a new issue. I probably won't bother but feel free to do so if you want.

Also note that this could be implemented for bash as well, once #15 is implemented.

@jeremywrnr
Copy link
Contributor

Good point that this could be also implemented in bash. You are right, it is fairly minor - I won't open a new issue.

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

No branches or pull requests

2 participants