Skip to content

Commit

Permalink
remember last directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ajashton committed Aug 27, 2016
1 parent 0ad8eb3 commit 9e76a10
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,27 @@ fi

if [[ -e "$(npm root -g)/mbxcli/mapbox.sh" && -n "$(which node)" ]]; then
source "$(npm root -g)/mbxcli/mapbox.sh"
function mbxc() {
mbx auth $* --account china
}
fi


# ---- History --------------------------------------------------------

shopt -s histappend
export PROMPT_COMMAND="history -a; history -n"
export PROMPT_COMMAND="history -a; history -n;"
export HISTCONTROL=erasedups
export HISTFILE="$HOME/.bash_history"
export HISTSIZE=50000
export HISTIGNORE='&:ls:cd ~:cd ..:[bf]g:exit:h:history'

# ---- Remember last CWD ----------------------------------------------
PROMPT_COMMAND+=" pwd > $HOME/.cache/lwd;"
if [[ -e "$HOME/.cache/lwd" ]]; then
cd "$(< ${HOME}/.cache/lwd)"
fi

# ---- Window Title ---------------------------------------------------

# If we're inside a tmux or screen session, set title to the current
Expand All @@ -64,7 +73,7 @@ function pwd_abbr () {
echo -ne "\ek$(pwd | sed s#$HOME#~# | sed 's#\([^/]\)[^/]*/#\1/#g')\e\\"
}
if (grep -qe '\(screen\|tmux\)' <<< "$TERM"); then
export PROMPT_COMMAND="$PROMPT_COMMAND; pwd_abbr;"
PROMPT_COMMAND+=" pwd_abbr;"
fi
# ---- Shell Prompt ---------------------------------------------------
Expand Down

0 comments on commit 9e76a10

Please sign in to comment.