this is already something...

pull/18/head
Joel Schaerer 15 years ago
parent d5a7c0579a
commit 4b64944832

@ -94,7 +94,7 @@ else:
else:
uniqadd(results,path)
if completion:
print " ".join(("%.4d)_%s" % (n,r) for n,r in enumerate(results)))
print " ".join(("%d)%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 $@ | sed 's/.*)_//');if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; echo; cd "$new_path";fi }
function j { new_path=$(autojump $@);if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; echo; cd "$new_path";fi }
fi

@ -0,0 +1,31 @@
# unrar(1) completion by Guillaume Rousse <rousse@ccr.jussieu.fr>
#
# $Id: unrar,v 1.4 2004/07/05 23:37:47 ianmacd Exp $
_autojump()
{
local cur
COMPREPLY=()
cur=${COMP_WORDS[1]}
COMPREPLY=($(autojump --completion "$cur"))
# case "$cur" in
# -*)
# COMPREPLY=( $( compgen -W '-ad -ap -av- -c- -cfg- -cl -cu \
# -dh -ep -f -idp -ierr -inul -kb -o+ -o- -ow -p -p- -r -ta \
# -tb -tn -to -u -v -ver -vp -x -x@ -y' -- $cur ) )
# ;;
# *)
# if [ $COMP_CWORD -eq 1 ]; then
# COMPREPLY=( $( compgen -W 'e l lb lt p t v vb vt x' -- $cur ) )
# else
# _filedir '@(rar|RAR)'
# fi
# ;;
# esac
return 0
}
complete -F _autojump j
Loading…
Cancel
Save