Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Instead of doing the sym link think manually there is a great script that is stupid simple to use and only a few lines in your zshrc/bashrc file.

It's called jump/mark. I aliased j to jump and added tab completion to zsh and it's made all the difference.

Usage

Mark .

Marks the current directory to be in the jump list.

Jump <dir name>

Jumps to that directory.

Zsh is a much nicer shell than bash too and there are no glaring incompatibility issues I have seen in daily usage.



Specifically for jump, from my .bashrc:

    export MARKPATH=$HOME/.marks
    function jump {
        cd -P $MARKPATH/$1 2> /dev/null || (echo "No such mark: $1" && marks)
    }
    function mark {
        mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1
    }
    function unmark {
        rm -i $MARKPATH/$1
    }
    function marks {
        ls -l $MARKPATH | sed 's/  / /g' | cut -d' ' -f9- && echo
    }
    _jump()
    {
        local cur=${COMP_WORDS[COMP_CWORD]}
        COMPREPLY=( $(compgen -W "$( ls $MARKPATH )" -- $cur) )
    }
    complete -F _jump jump


More information on jump and mark available at: http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-f...

Basically there is a jump oh-my-zsh plugin, but be sure to add the auto-completion mentioned in this article too...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: