1
0
mirror of https://github.com/wting/autojump synced 2024-09-28 14:00:46 +00:00
wting_autojump/autojump.bash
Simon Marache-Francisco 0136d8f138 Just a Test
2009-03-27 16:54:55 +01:00

24 lines
567 B
Bash

#This shell snippet sets the prompt command and the necessary aliases
# TODO
_autojump()
{
local cur
COMPREPLY=()
unset COMP_WORDS[0] #remove "j" from the array
cur=${COMP_WORDS[*]}
IFS=$'\n' read -d '' -a COMPREPLY < <(autojump --completion "$cur")
return 0
}
complete -F _autojump j
function preexec() {
autojump -a "$(pwd -P)"&)>/dev/null
}
# OK
alias jumpstat="autojump --stat"
function j { new_path="$(autojump $@)";if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; cd "$new_path";fi }