Skip to content

Instantly share code, notes, and snippets.

@jan-warchol
Created March 21, 2018 10:02
Show Gist options
  • Save jan-warchol/4a018fcc8a9f4f2ac8632093339fc885 to your computer and use it in GitHub Desktop.
Save jan-warchol/4a018fcc8a9f4f2ac8632093339fc885 to your computer and use it in GitHub Desktop.
Miscellaneous bash history settings
# enable keeping history timestamps and set display format to ISO-8601
export HISTTIMEFORMAT="%F %T "
# ignore duplicates and commands starting with space
HISTCONTROL=ignoreboth
# ignore specific commands (full-length match)
HISTIGNORE=”?:cd:ls:ll:bg:fg:vim:git status”
# disable terminal flow control key binding, so that ^S will search history forward
stty -ixon
# make Ctrl-up/down search history for commands starting with currently
# typed prefix (unlike Ctrl-R/S, which searches entire command string).
"\e[1;5A":history-search-backward
"\e[1;5B":history-search-forward
"\e[5A": history-search-backward
"\e[5B": history-search-forward
"\e\e[A": history-search-backward
"\e\e[B": history-search-forward
# Also bind this to up and down arrow
"\e[1;A":history-search-backward
"\e[1;B":history-search-forward
"\e[A": history-search-backward
"\e[B": history-search-forward
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment