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

Idea: autocomplete for jc, jo, jco #185

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

grota
Copy link

@grota grota commented Mar 10, 2014

Here's an idea for a new feature: autocomplete functions for jc jo and jco.
The one for jo should be the same already existing for j.
I can give it a go in my spare time if you want.
IMHO, from an usability point of view, I don't think I would even use autojump without an autocomplete function, so I think that an autocomplete for those 3 functions would be very very useful, even a "must have".

@wting
Copy link
Owner

wting commented May 14, 2013

Sounds like a good idea.

@grota
Copy link
Author

grota commented May 16, 2013

autocomplete for jo seems to be a one liner (same as the one for j) while autocomplete for jc and jco seems to require changes to the script itself, which I am not able to do (I don't know python).
Any thoughts?

@grota
Copy link
Author

grota commented Sep 1, 2013

ping

@wting
Copy link
Owner

wting commented Sep 1, 2013

Off the top of my head I'm not sure how autocomplete for jc and jco would work. Say you had a directory /foo/bar/baz and typed in jc fo ba. How would you know which element to autocomplete?

@grota
Copy link
Author

grota commented Sep 1, 2013

I might be saying something stupid here because I haven't been using jc for a long time (due in fact to the lack of autocompletion), so if that's the case, apologies in advance.

I'm assuming that in this case the pwd is / and we are issuing jc fo ba, right? I think the answer to your question would be "both if both dirs are in the database, and ordered depending on their weight"

@wting
Copy link
Owner

wting commented Mar 10, 2014

Just a follow up, this isn't a bad idea but to be honest it's a lot of work. If you or someone else decides to implement this I'd be more than happy to merge the pull request.

@grota
Copy link
Author

grota commented Mar 10, 2014

For jc and jco I'll try to figure out if filtering the output of autojump --complete $PWD is feasible (using only shell scripting).
I guess I'll end up with holes in the list numbering but it's better than nothing I guess

@grota
Copy link
Author

grota commented Mar 10, 2014

Ok, so I've transformed this issue in a pull request.
I've asked and it seems like the use case we outlined above is not possible (in bash).
I'm not 100% satisfied with the current code but I don't know python so I don't feel comfortable digging further.

@grota
Copy link
Author

grota commented Mar 10, 2014

I've added another commit where I use aliases for jc and jco.
Not sure if this is the correct approach, it needs another set of eyes.

@blueyed
Copy link
Collaborator

blueyed commented Jun 23, 2014

Not sure if this is the correct approach, it needs another set of eyes.

This does not make sense, since e.g. jc foo is supposed to limit the queries to subdirectories, which is not given anymore then.

Regarding your question on SO: you do not need to replace what's on the user's command line, do you? You only need to change the command used for getting completions.

FWIW, i would be more interested in zsh completion for it.. ;)

@liuyang1
Copy link

i love this ieda, and now i implement it partly.
now jc can only check child directories, jco also works.
i add this feature for bash and zsh, as i only know this two shell.
under zsh, it seems work good.

now i want add auto completion feature for jc under ZSH, but i can't find how to deal it?
who can give some tips?
Thanks!

@dcy10000
Copy link

I add compdef jo=j into the end of .zshrc. It works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants