You are not logged in.
You might remember my last week's post announcing autojump, a tool for faster filesystem navigation. Well, due to popular demand, I've now added autocompletion!
Autojump is a little tool I wrote that allows you to "jump" around your filesystem by maintaining a list of the directories you use the most. To put it simply, if you wanted to go to a directory called "/home/john/documents/projects/DADVSI/legal", you could type "j leg" or "j legal" or "j gal" or even "j VSI/leg", and it would jump to the right directory.
Of course sometimes you might want to know where you're jumping before you do the jump. That's why I added autocompletion, which makes the tool more convenient.
More details on the autojump on the wiki: http://wiki.github.com/joelthelion/autojump
And as always, installation is only a
yaourt -S autojump
away!
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
very nice, i like the autocompletion
Offline
zsh version:
*** /home/vyazovoi/autojump 2009-02-21 09:52:55.000000000 +0500
--- /usr/bin/autojump 2009-02-20 15:08:27.000000000 +0500
***************
*** 113,118 ****
if userchoice!=-1:
if len(results) > userchoice-1 : print results[userchoice-1]
elif len(results) > 1 and completion:
! print "\n".join(("%s__%d__%s" % (pattern,n+1,r) for n,r in enumerate(results[:8])))
else:
if results : print results[0]
--- 113,119 ----
if userchoice!=-1:
if len(results) > userchoice-1 : print results[userchoice-1]
elif len(results) > 1 and completion:
! # print "\n".join(("%s__%d__%s" % (pattern,n+1,r) for n,r in enumerate(results[:8])))
! print "\n".join(("%s" % (r) for n,r in enumerate(results[:8])))
else:
if results : print results[0]
if [ -n "$PS1" ]; then
function _autojump_completer
{
read -Ac line
reply=($(autojump --completion $line[2]))
}
compctl -K _autojump_completer j
function precmd { autojump -a "$(pwd -P)" }
alias jumpstat="autojump --stat"
function j { new_path="$(autojump $@)";if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; echo; cd "$new_path";fi }
fi
P.S. autocompletion is not good currently, I fix this later.
Last edited by Vyazovoi (2009-02-21 04:59:35)
Offline
zsh version:
snip code
P.S. autocompletion is not good currently, I fix this later.
Don't hesitate to contact me if you get it to work well.
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
sweet little app!
I just started trying it out after seeing it mentioned in the newsletter. Ya know, if you add an alias to make 'cd' run autojump, this becomes even more useful, then it almost seems like a new feature of cd.
I wonder if it could become robust enough to actually replace cd entirely in the future.
I keep getting distracted from my webserver project...
huh? oooh... shiny!
Offline
This is beautiful. Thank you.
LeoSolaris: autojump needs to echo the dir it switched to - that's unavoidable. I don't like this echo when doing a simple 'cd ..' that might be just me, though.
Off: Also, hi all. I just registered to the forums after using Arch for a half year or so.
Linux user #476135 || Dotfiles hosted by GitHub
Offline
Beautiful!
Thanks!
Offline
Thanks to both of you for your nice comments
absesto I agree with you, I think autojump and cd should better stay separate. cd is still useful for relative path navigation, such as cd .. .
One improvement I am currently thinking about is performance. I wonder if implementing autojump as a daemon could improve performance?
As a side note you might have noticed that autojump is now in community. Thanks a lot to gcarrier for promoting it!
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
this package is, in all honesty, just incredible.
brilliant.
thank you immeasurably
Offline
Just WHAO, its fantastic.
Offline
I was skeptical that anything could instantly improve on cd, but your little program is great. Thank you!
Offline
is the package in the repo broken or am im just completely oblivious on how to use this? man jumpstat gives me the man page yet 'j [directory]' and 'jumpstat' both return with command not found
Offline
is the package in the repo broken or am im just completely oblivious on how to use this? man jumpstat gives me the man page yet 'j [directory]' and 'jumpstat' both return with command not found
Sounds like you didn't source /etc/profile in ~/.bashrc as described in the post-install message.
EDIT: Or you could just copy the content of /etc/profile.d/autojump.bash into your ~/.bashrc.
Last edited by Runiq (2009-03-08 08:34:37)
Offline
I didnt see that since I installed it via shaman :-/
Offline
Sounds like you didn't source /etc/profile in ~/.bashrc as described in the post-install message.
EDIT: Or you could just copy the content of /etc/profile.d/autojump.bash into your ~/.bashrc.
Yep, that's the crucial part. I don't want to do it automatically since a .bashrc file is very personal, so autojump won't work if the user doesn't read the post_install message :-/
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
Runiq wrote:Sounds like you didn't source /etc/profile in ~/.bashrc as described in the post-install message.
EDIT: Or you could just copy the content of /etc/profile.d/autojump.bash into your ~/.bashrc.Yep, that's the crucial part. I don't want to do it automatically since a .bashrc file is very personal, so autojump won't work if the user doesn't read the post_install message :-/
Well, I don't actually use /etc/profile (unless it's sourced in some rc.* script), so I sourced it once and was put off by a non-colored prompt.
Offline
Well, I don't actually use /etc/profile (unless it's sourced in some rc.* script), so I sourced it once and was put off by a non-colored prompt. tongue
If you don't want to source /etc/profile (which i understand), you can source /etc/profile.d/autojump.bash directly. Maybe this is what I should recommend in the install file.
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
Well, I don't actually use /etc/profile (unless it's sourced in some rc.* script), so I sourced it once and was put off by a non-colored prompt. tongue
If you don't want to source /etc/profile (which i understand), you can source /etc/profile.d/autojump.bash directly. Maybe this is what I should recommend in the install file.
...d'oh! Of course. Thank you.
Offline
I have
source /etc/profile.d/autojump.bash
in my ~/.bashrc, but autocompletion isn't working.
Is there anything else I need to do?
Offline
I have
source /etc/profile.d/autojump.bash
in my ~/.bashrc, but autocompletion isn't working.
Is there anything else I need to do?
Do you have bash-completion installed? I guess it should at least be in the optional dependencies of the package.
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
Yeah, and I have
source /etc/bash_completion
in my ~/.bashrc as well.
Offline
Did you just install autojump? what is the output of "jumpstat"? Autojump's autocompletion is quite peculiar, don't expect it to work like completion for cd for example.
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
Yeah, I just hadn't grasped how the autocompletion works, i was expecting it to work like cd, when navigating to a directory.
Would be nice if it worked like cd, haha, would make a pretty much total replacement.
However, as a feature request, if autojump didn't print a spare newline after showing what directory is jumped too, I'd be very happy
For example:
joe@joanna:~ > j Tech
/home/joe/Tech
joe@joanna:~/Tech >
Where there's an unnecessary newline.
Offline
I'm glad it finally worked for you You can remove the newline quite easily, there's an extra "echo" that does just that in the "j" function in autojump.bash. I've also removed it in the dev branch
Thanks for the report!
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
Works even better now
Offline