You are not logged in.
I've just uploaded a new release of autojump, the cd command that learns.
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.
The new release brings a couple new features and several bug fixes. One new feature is the support for multiple patterns: sometimes it is easier to refer to a path by several patterns instead of one. Furthermore, all but the last pattern can refer to the full path, which can be handy when you have several directories with the same name. Say you have
~/src/project1/bin
~/src/project2/bin
If you want to make sure autojump jumps to the bin directory for project2, you can enter:
j 2 bi
Another new feature is improved support for removable media: instead of immediately purging non-existent directories, autojump now keeps them in the hope that they may one day be available again.
As usual, autojump is available for both bash and zsh. The new version hasn't reached the arch repos yet, but if you can't wait, you can always get the autojump-git package.
Enjoy!
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
I love autojump, but I don't get what's new about this release... I'm doing the "j 2 bin" thing with the current version already.
Or more exactly:
$ j ld
/home/olivier/builds
$ j jeu ld
/mnt/data/Jeux/LD18
Offline
Actually you're right, multiple patterns have been there for a while. But since I hadn't described them here (it's been a while since I haven't posted anything about autojump), I thought I'd take the occasion to explain the idea.
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
This is a real timesaver. great app! I already had some aliases in my bash profile to use history, but not as nice as this.
I did find a little bug though. After installing on my headless server:
source /etc/profile
mkdir: cannot create directory `/home/user1/.local/share/autojump': No such file or directory
you seem to assume that there is a '~/.local/share' folder, but in my case it isn't there. How about create it if it doesn;t exist?
Last edited by rwd (2010-08-29 21:57:26)
Offline
If there's no match in the database for the given pattern, could you then check the current directory? I've aliased j to cd for a while now, and it's jarring having to go back to cd-ing when using a program that's supposed to *reduce* keystrokes.
Offline
It's not a good idea to alias cd to autojump! I mean, I could do what you request, but then "cd -" wouldn't work, autocompletion wouldn't work, and there might be ambiguities between the local path and another path. I think it's best to keep both commands, and use j as a complement to cd to jump to far paths.
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
Sorry, I meant I had j aliased to cd before trying autojump. I think it'd be nice to have autojump work as a wrapper around cd, so that it didn't just fail when trying to enter new directories. Also, could you emit an error message instead of just silently failing, eg, `no match found`?
Anyway, how can I make autojump auto display the directory contents? I can do `k() { j "$@"; ls; }`, but I'd like to keep using j.
Offline
Sorry, I meant I had j aliased to cd before trying autojump. I think it'd be nice to have autojump work as a wrapper around cd, so that it didn't just fail when trying to enter new directories. Also, could you emit an error message instead of just silently failing, eg, `no match found`?
Ah, I understand better now! I don't want to change the current behavior, since I like it better the current way, but it should be fairly easy to change. For example, to add a "no match found" error message, adding
elif not completion: print >>stderr, "no match found."
at the end of the autojump file should suffice.
Anyway, how can I make autojump auto display the directory contents? I can do `k() { j "$@"; ls; }`, but I'd like to keep using j.
The definition of the bash j function is in autojump.bash, it should be fairly easy to add an ls at the end:
function j { new_path="$(autojump $@)";if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; cd "$new_path";ls;fi }
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
Thanks a bunch.
Offline
Nice util, thanks for sharing.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Anyone else experiencing problems recently?
$ j sh
Problem with autojump database, trying to recover from backup...
Traceback (most recent call last):
File "/usr/bin/autojump", line 132, in <module>
path_dict=open_dic(dic_file)
File "/usr/bin/autojump", line 117, in open_dic
shutil.copy(dic_file+".bak",dic_file)
File "/usr/lib/python2.7/shutil.py", line 116, in copy
copyfile(src, dst)
File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/home/user/.local/share/autojump/autojump_py'
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Anyone else experiencing problems recently?
This should be solved now. Could you upgrade to the latest git version, unset the PROMPT_COMMAND, source your bashrc (or just reboot :-)), fix the permissions, and tell me if it works for you?
If it is indeed solved, I will make a new release in the next few days. Sorry for the inconvenience.
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
@lardon - yeah pulling the git now.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
@lardon - no errors so far and I've been banging on it pretty hard.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
I've installed it, but it doesn't seem to work
How am i supposed to use it? Does it monitor the dirs i cd into, or do i have to use "j directory" to build its cache?
jumpstat prints no directories (Total key weight: 0. Number of stored paths: 0), no matter how i jump around (using cd or autojump)
Also, bash autocompletion doesn't seem to work (j /home/<tab> does nothing)
/etc/profile is sourced by my user's .bashrc.
How to proceed from here?
Offline
@Hoek - did you read the pacman output?
echo " > You need to source /etc/profile in your ~/.bashrc for this to work"
echo " > Only guaranteed to work with bash"
echo " > man autojump for instructions."
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
neat tool, saves a lot of time
haven't tested it for a long time but works errorfree for me
thanks for making this
Offline
@graysky : thanks for testing! I guess everything is in order to make a new release
@Hoek : were you able to solve your problem?
@vanvalium : thanks!
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
This is an essential time saver for command line users. Thanks for making this.
Offline
Autojump looks like just the program for an old CLI user like me.
However I'm getting a syntax error when I run it:
File "/usr/bin/autojump", line 31
print "Received SIGINT, trying to continue"
^
I've looked at the script but the source of the error isn't jumping out at me.
I installed the program as root. And it modified my personal .bashrc file:
# Added by autojump install.sh
source /etc/profile.d/autojump.bash
I'm running an up to date version of Arch.
I've sourced /etc/profile.
jumpstat gives me the same error.
Thanks.
Offline
Autojump looks like just the program for an old CLI user like me.
However I'm getting a syntax error when I run it:
File "/usr/bin/autojump", line 31
print "Received SIGINT, trying to continue"
^
I've looked at the script but the source of the error isn't jumping out at me.Thanks.
Hi,
the problem is almost certainly caused by the fact that Arch's default version of python is Python3.
You can either:
- Upgrade to the latest git version of autojump, which should support both python3 and python2.
- or used the packaged version of autojump which explicitly calls python2.
In any case I'll try to release an updated version of autojump in the next few days.
Don't hesitate to tell me if this doesn't fix your problem, I'll be happy to help.
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
Hi,
the problem is almost certainly caused by the fact that Arch's default version of python is Python3.
You can either:
- Upgrade to the latest git version of autojump, which should support both python3 and python2.
- or used the packaged version of autojump which explicitly calls python2.In any case I'll try to release an updated version of autojump in the next few days.
Don't hesitate to tell me if this doesn't fix your problem, I'll be happy to help.
Ah. I didn't even try to install it via pacman.
I downloaded "autojump_v13.tar.gz" from the git download page and that's the one I had problems with.
I removed the individual components of the previous install and reinstalled via pacman and all is well.
Thanks for the prompt reply. I'm looking forward to this little program.
Last edited by whatshisname (2010-12-06 02:39:35)
Offline
I still have a problem with autojump.
With the AUR version (git) or the version from community:
Traceback (most recent call last):
File "/usr/bin/autojump", line 236, in <module>
success=shell_utility()
File "/usr/bin/autojump", line 157, in shell_utility
path_dict = open_dic(dic_file)
File "/usr/bin/autojump", line 130, in open_dic
path_dict = pickle.load(aj_file, encoding="utf-8")
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8c in position 23: ordinal not in range(128)
(I do have source /etc/profile in my .bashrc)
Last edited by farvardin (2011-05-14 13:51:00)
Offline
Hi farvadin,
Have you been going back and forth between the two versions? What python interpreter are you using (check the shebang in /usr/bin/autojump)?
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
@lardon - what is the safe way to reset my autojump database?
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline