Skip to content

Instantly share code, notes, and snippets.

@elipapa
Last active November 28, 2017 15:47
Show Gist options
  • Save elipapa/7906dedad15702f1f1f0bcaf50e6f06d to your computer and use it in GitHub Desktop.
Save elipapa/7906dedad15702f1f1f0bcaf50e6f06d to your computer and use it in GitHub Desktop.
# Sensible Bash - An attempt at saner Bash defaults
# Repository: https://github.com/mrzool/bash-sensible
## GENERAL OPTIONS ##
set -o noclobber
shopt -s checkwinsize
PROMPT_DIRTRIM=2
bind Space:magic-space
shopt -s globstar 2> /dev/null
shopt -s nocaseglob;
## SMARTER TAB-COMPLETION (Readline bindings) ##
# bind "set completion-ignore-case on"
# bind "set completion-map-case on"
# bind "set show-all-if-ambiguous on"
# bind "set mark-symlinked-directories on"
## SANE HISTORY DEFAULTS ##
shopt -s histappend
shopt -s cmdhist
PROMPT_COMMAND='history -a'
HISTSIZE=500000
HISTFILESIZE=100000
HISTCONTROL="erasedups:ignoreboth"
export HISTIGNORE="&:[ ]*:exit:ls:bg:fg:history:clear"
HISTTIMEFORMAT='%F %T '
# Enable incremental history search with up/down arrows (also Readline goodness)
# bind '"\e[A": history-search-backward'
# bind '"\e[B": history-search-forward'
# bind '"\e[C": forward-char'
# bind '"\e[D": backward-char'
## BETTER DIRECTORY NAVIGATION ##
shopt -s autocd 2> /dev/null
shopt -s dirspell 2> /dev/null
shopt -s cdspell 2> /dev/null
CDPATH="."
# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment