mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
this is already something...
This commit is contained in:
parent
d5a7c0579a
commit
4b64944832
2
autojump
2
autojump
@ -94,7 +94,7 @@ else:
|
|||||||
else:
|
else:
|
||||||
uniqadd(results,path)
|
uniqadd(results,path)
|
||||||
if completion:
|
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)
|
cPickle.dump(path_dict,open(dic_file+".tmp",'w'),-1)
|
||||||
import shutil
|
import shutil
|
||||||
shutil.copy(dic_file+".tmp",dic_file) #cPickle.dump doesn't seem to be atomic, so this is more secure
|
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
|
if [ $SHELL = "/bin/bash" ]; then
|
||||||
export PROMPT_COMMAND='autojump -a "$(pwd -P)";'"$PROMPT_COMMAND"
|
export PROMPT_COMMAND='autojump -a "$(pwd -P)";'"$PROMPT_COMMAND"
|
||||||
alias jumpstat="autojump --stat"
|
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
|
fi
|
||||||
|
31
autojump_completion
Normal file
31
autojump_completion
Normal file
@ -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…
Reference in New Issue
Block a user