Thursday, July 10, 2014

windows - Sync left pane in Explorer with opened folder

Click on an empty space on the left pane, enable: "Show all folders" and "Expand to current folder"

Source

Monday, July 7, 2014

bash - history sharing between sessions


# .bash_rc
HISTSIZE=9000
HISTFILESIZE=$HISTSIZE
HISTCONTROL=ignorespace:ignoredups

history() {
  _bash_history_sync
  builtin history "$@"
}

_bash_history_sync() {
  builtin history -a         #1
  HISTFILESIZE=$HISTSIZE     #2
  builtin history -c         #3
  builtin history -r         #4
}

PROMPT_COMMAND=_bash_history_sync


history() overrides the original function to make sure that the history is synchronised before it is printed, so the numbers match.

Source | cheat sheet (pdf) | Nice article