Idea: autocomplete for jc, jo, jco
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".
Sounds like a good idea.
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?
ping
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?
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"
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.
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
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.
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.
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.. ;)
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!
I add compdef jo=j into the end of .zshrc. It works for me.