cat >> ~/.inputrc
:
# Respect default shortcuts.
$include /etc/inputrc
## arrow up
"\e[A":history-search-backward
## arrow down
"\e[B":history-search-forward
# enable colors when completing filenames and directories
set colored-stats on
# when a completion matches multiple items highlight the common matching prefix in color
set colored-completion-prefix on
# ignore case when completing
set completion-ignore-case on
# automatically append the / slash character to the end of symlinked directories when completing
set mark-symlinked-directories on
# disable the completions pager and set 200 as the prompt-to-display limit
set page-completions off
set completion-query-items 200
# disable beeps & bells, and do not display control characters
set bell-style none
set echo-control-characters off
# display completion matches upon the first press of the TAB key
set show-all-if-ambiguous on
# the first press of the completion key, TAB, will display a list of choices that match the given prefix, whilst the next press of the completion key will start cycling through the available choices
set menu-complete-display-prefix on
# the TAB key cycles forward through the completion choices. Press an arrow key, such as right-arrow, to choose a selection
TAB: menu-complete
# the Shift-TAB key cycles backward through the completion choices. This is useful if you pressed TAB too many times and overshot the desired choice. Like TAB, press an arrow key, such as right-arrow, to choose a selection
"\e[Z": menu-complete-backward
cat >> ~/.bashrc
:
# Ignore commands starts with space and remove duplicate commands
HISTCONTROL=ignoreboth:erasedups
# Limit history size
HISTSIZE=1000
# Limit history in file
HISTFILESIZE=2000
# Add new commands to end of file
shopt -s histappend
# Check terminal windows size after command execute
shopt -s checkwinsize
# Autofix cd typos
shopt -s cdspell
# Autofix dir typos
shopt -s dirspell
# Automatic expand dir names
shopt -s direxpand
# Turn on ** in patterns. Any number of subdirectories (including none)
shopt -s globstar
# Save multiline commands as one
shopt -s cmdhist
# Allow more regexp patterns
shopt -s extglob
# cd without cd
shopt -s autocd
# 256-color terminal mode
export TERM=xterm-256color
# Settings for `less`
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;33m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;42;30m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;36m'
set match-hidden-files off
set page-completions off
set completion-query-items 350
set show-all-if-ambiguous on
alias ll='ls -lahGpF --group-directories-first --color=always'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Save history after each command
export PROMPT_COMMAND='history -a'