This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# per-directory history | |
shopt -s histappend # always append to history, don't replace | |
export PROMPT_COMMAND="builtin history -a;$PROMPT_COMMAND" # write to history file at every new prompt | |
export HISTTIMEFORMAT="%m/%d/%y %T " | |
alias cd='cd_with_local_history' | |
alias history='cat $HOME/.bash_history' | |
export HISTFILE="$PWD/.bash_cwd_history_$USER" | |
function cd_with_local_history() |