dotfiles/bashrc

61 lines
1.4 KiB
Bash
Raw Normal View History

2018-07-15 10:24:42 +02:00
# -*- sh -*-
2018-07-15 09:47:03 +02:00
2018-07-15 10:24:42 +02:00
# Based on example .bashrc as provided by Debian
2018-07-15 09:47:03 +02:00
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
2018-07-15 10:24:42 +02:00
# History control
2018-07-15 09:47:03 +02:00
HISTCONTROL=ignoreboth
2018-07-15 10:24:42 +02:00
HISTZIE=20000
2018-07-15 09:47:03 +02:00
2018-07-15 10:24:42 +02:00
# Append to the history file, don't overwrite it
2018-07-15 09:47:03 +02:00
shopt -s histappend
2018-07-15 10:24:42 +02:00
# Correctly save multiline commands in the history
shopt -s cmdhist
shopt -s lithist
2018-07-15 09:47:03 +02:00
# No clobbering
shopt -o -s noclobber
2018-07-15 10:41:58 +02:00
# Extended globbing
shopt -s extglob
2018-07-15 10:24:42 +02:00
# Check the window size after each command and, if necessary,
# Update the values of LINES and COLUMNS.
2018-07-15 09:47:03 +02:00
shopt -s checkwinsize
2018-07-15 10:24:42 +02:00
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
2018-07-15 09:47:03 +02:00
2019-06-01 21:45:25 +02:00
# Simple prompt
if [[ "$TERM" = "dumb" ]]; then
PS1="> "
else
PS1="┌[\e[0;32m\u@\h\e[m] [\e[0;31m\w\e[m] [\t]\n└── "
fi
2018-07-15 09:47:03 +02:00
2018-07-15 10:24:42 +02:00
# Enable color support of ls and also add handy aliases
2018-07-15 09:47:03 +02:00
if [ -x /usr/bin/dircolors ]; then
2018-07-15 10:24:42 +02:00
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
2018-07-15 09:47:03 +02:00
fi
2018-07-15 10:24:42 +02:00
# Some more ls aliases
2018-07-15 09:47:03 +02:00
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias ..='cd ..'
# 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 [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi