dotfiles-server/.bashrc

87 lines
2.4 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2016-05-07 20:56:50 +02:00
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# ----------------------------------------------------------------------
# SHELL OPTIONS
# ----------------------------------------------------------------------
# Append to the Bash history file, rather than overwriting it
2016-05-07 20:56:50 +02:00
shopt -s histappend
2017-03-24 03:18:16 +01:00
# Save multi-line commands as one command
shopt -s cmdhist
# Avoid duplicate entries
HISTCONTROL="erasedups:ignoreboth"
# Don't record some commands
export HISTIGNORE="&:[ ]*:exit:ls:bg:fg:history:clear"
# fuck that you have new mail shit
unset MAILCHECK
# Case-insensitive globbing (used in pathname expansion)
shopt -s nocaseglob
2017-03-24 03:18:16 +01:00
# Turn on recursive globbing (enables ** to recurse all directories)
shopt -s globstar 2> /dev/null
# Prepend cd to directory names automatically
shopt -s autocd 2> /dev/null
2017-03-24 03:18:16 +01:00
# Correct spelling errors during tab-completion
shopt -s dirspell 2> /dev/null
2016-05-07 20:56:50 +02:00
2017-03-24 03:18:16 +01:00
# Correct spelling errors in arguments supplied to cd
shopt -s cdspell 2> /dev/null
# Update window size after every command
2016-05-07 20:56:50 +02:00
shopt -s checkwinsize
2017-03-24 03:18:16 +01:00
# Automatically trim long paths in the prompt (requires Bash 4.x)
PROMPT_DIRTRIM=4
# Perform file completion in a case insensitive fashion
bind "set completion-ignore-case on"
# Treat hyphens and underscores as equivalent
bind "set completion-map-case on"
# Display matches for ambiguous patterns at first tab press
bind "set show-all-if-ambiguous on"
# Immediately add a trailing slash when autocompleting symlinks to directories
bind "set mark-symlinked-directories on"
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
2016-05-07 20:56:50 +02:00
# LSCOLORS
export CLICOLOR=1
export LSCOLORS=gxfxcxdxbxegedabagacad
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi