mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
small changes
This commit is contained in:
parent
d4eae3ef98
commit
3ff9135aa1
8
autojump
8
autojump
@ -81,7 +81,8 @@ else:
|
||||
print path
|
||||
found=True
|
||||
break
|
||||
else: uniqadd(results,path)
|
||||
else:
|
||||
uniqadd(results,path)
|
||||
dirs=path_dict.items() #we need to recreate the list since the first iteration potentially deletes paths
|
||||
dirs.sort(key=lambda e:e[1],reverse=True)
|
||||
if not found:
|
||||
@ -90,9 +91,10 @@ else:
|
||||
if not completion:
|
||||
print path
|
||||
break
|
||||
else: uniqadd(results,path)
|
||||
else:
|
||||
uniqadd(results,path)
|
||||
if completion:
|
||||
print " ".join(results)
|
||||
print " ".join(("%.4d)_%s" % (n,r) for n,r in enumerate(results)))
|
||||
cPickle.dump(path_dict,open(dic_file+".tmp",'w'),-1)
|
||||
import shutil
|
||||
shutil.copy(dic_file+".tmp",dic_file) #cPickle.dump doesn't seem to be atomic, so this is more secure
|
||||
|
@ -1,5 +1,5 @@
|
||||
if [ $SHELL = "/bin/bash" ]; then
|
||||
export PROMPT_COMMAND='autojump -a "$(pwd -P)";'"$PROMPT_COMMAND"
|
||||
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 }
|
||||
function j { new_path=$(autojump $@ | sed 's/.*)_//');if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; echo; cd "$new_path";fi }
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user