mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
OMB - Major Refactor (#39)
* OMB - Major Refactor - Aliases and completions now works like plugins (need to enabled in .bashrc) - Removed the compatible check in spectrum.sh, OMB now works with Bash v3.x like the old days. - Removed core plugin, added those bash functions into base.sh and load during startup. - Updated OSH template for new installations - Added history config and few other stuff from #17 @TODO: Added a shell script to update old version of .bashrc to new one. * Fixed ShellCheck issues * Fixed ShellCheck issues
This commit is contained in:
@@ -3,11 +3,53 @@ shopt -s histappend # append to bash_history if Terminal.app quits
|
||||
|
||||
## Command history configuration
|
||||
if [ -z "$HISTFILE" ]; then
|
||||
HISTFILE=$HOME/.bash_history
|
||||
HISTFILE=$HOME/.bash_history
|
||||
fi
|
||||
|
||||
HISTSIZE=10000
|
||||
SAVEHIST=10000
|
||||
|
||||
# some moderate history controls taken from sensible.bash
|
||||
## SANE HISTORY DEFAULTS ##
|
||||
|
||||
# Append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
# Save multi-line commands as one command
|
||||
shopt -s cmdhist
|
||||
|
||||
# use readline on history
|
||||
shopt -s histreedit
|
||||
|
||||
# load history line onto readline buffer for editing
|
||||
shopt -s histverify
|
||||
|
||||
# save history with newlines instead of ; where possible
|
||||
shopt -s lithist
|
||||
|
||||
# Record each line as it gets issued
|
||||
PROMPT_COMMAND='history -a'
|
||||
|
||||
# Huge history. Doesn't appear to slow things down, so why not?
|
||||
HISTSIZE=500000
|
||||
HISTFILESIZE=100000
|
||||
|
||||
# Avoid duplicate entries
|
||||
HISTCONTROL="erasedups:ignoreboth"
|
||||
|
||||
# Don't record some commands
|
||||
export HISTIGNORE="&:[ ]*:exit:ls:bg:fg:history:clear"
|
||||
|
||||
# Use standard ISO 8601 timestamp
|
||||
# %F equivalent to %Y-%m-%d
|
||||
# %T equivalent to %H:%M:%S (24-hours format)
|
||||
HISTTIMEFORMAT='%F %T '
|
||||
|
||||
# Enable incremental history search with up/down arrows (also Readline goodness)
|
||||
# Learn more about this here: http://codeinthehole.com/writing/the-most-important-command-line-tip-incremental-hi
|
||||
# bash4 specific ??
|
||||
bind '"\e[A": history-search-backward'
|
||||
bind '"\e[B": history-search-forward'
|
||||
bind '"\e[C": forward-char'
|
||||
bind '"\e[D": backward-char'
|
||||
|
||||
# Show history
|
||||
#case $HIST_STAMPS in
|
||||
@@ -16,12 +58,3 @@ SAVEHIST=10000
|
||||
#"yyyy-mm-dd") alias history='fc -il 1' ;;
|
||||
#*) alias history='fc -l 1' ;;
|
||||
#esac
|
||||
|
||||
#shopt append_history
|
||||
#shopt extended_history
|
||||
#shopt hist_expire_dups_first
|
||||
#shopt hist_ignore_dups # ignore duplication command history list
|
||||
#shopt hist_ignore_space
|
||||
#shopt hist_verify
|
||||
#shopt inc_append_history
|
||||
#shopt share_history # share command history data
|
||||
|
Reference in New Issue
Block a user