Hacker News new | past | comments | ask | show | jobs | submit login

I use jump commands:

export MARKPATH=$HOME/.marks function jump { cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1" } function ju { cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1" } 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- | sed 's/ -/\t-/g' && echo }

I think the original source is #http://jeroenjanssens.com/2013/08/16/quickly-navigate-your-f...

Another neat trick is to set you .inputrc to vi mode with

set editing-mode vi set keymap vi

and then put this in your .bashrc

bind -m vi-insert -x '"\C-h"':'"pushd . 1>/dev/null 2>/dev/null && cd ../ && echo -e ${LILA} $PWD && ls"' bind -m vi-insert -x '"\C-n"':'"popd 1>/dev/null 2>/dev/null && echo -e ${LILA} $PWD && ls"' bind -m vi-insert -x '"\C-b":"cd $HOME && echo -e ${LILA} $PWD && ls"'

This enables you to go a directory up using ctrl-h and go back using ctrl-n.




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

Search: