commit b912cc3a2c4f8aff27fcf7942415c8940a0badf1 Author: David Thurstenson Date: Wed Jan 20 11:06:54 2016 -0600 initial commit diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..a360f9f --- /dev/null +++ b/.bash_profile @@ -0,0 +1,6 @@ +# +# ~/.bash_profile +# + +[[ -f ~/.bashrc ]] && . ~/.bashrc + diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..f717323 --- /dev/null +++ b/.bashrc @@ -0,0 +1,61 @@ +# +# ~/.bashrc +# +# Thurstylark + +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +export EDITOR=vim + +# Don't put duplicate lines or lines starting with space in the history. +# See bash(1) for more options +HISTCONTROL=ignoreboth + +# Enable pkgfile to automatically search for packages: +source /usr/share/doc/pkgfile/command-not-found.bash + +# If a directory is given without any +# command, CD into it. +shopt -s autocd + +# Enables colored Man pages: +man() { + env LESS_TERMCAP_mb=$'\E[01;31m' \ + LESS_TERMCAP_md=$'\E[01;38;5;74m' \ + LESS_TERMCAP_me=$'\E[0m' \ + LESS_TERMCAP_se=$'\E[0m' \ + LESS_TERMCAP_so=$'\E[38;5;246m' \ + LESS_TERMCAP_ue=$'\E[0m' \ + LESS_TERMCAP_us=$'\E[04;38;5;146m' \ + man "$@" +} + + +### PROMPT ### + +# [hh:mm][username@hostname pwd]$ +if [ -n "$SSH_CLIENT" ]; then +# Remotely, hostname is red. + PS1="\[\033[38;5;4m\][\A]\[$(tput sgr0)\]\[\033[38;5;6m\][\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;14m\]\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;6m\]@\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;1m\]\h\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;6m\] \W]\[$(tput sgr0)\]\[\033[38;5;7m\]\\$ \[$(tput sgr0)\]" +else +# Locally, hostname is cyan. + PS1="\[\033[38;5;4m\][\A]\[$(tput sgr0)\]\[\033[38;5;6m\][\[$(tput bold)\]\[$(tput sgr0)\]\[\033[38;5;14m\]\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;6m\]@\h \W]\[$(tput sgr0)\]\[\033[38;5;7m\]\\$ \[$(tput sgr0)\]" +fi + + +### ALIASES ### + +# Colorize all `ls` output: +alias ls='ls -F --color=auto' +# Map "la" to `ls -la` +alias la='ls -laF --color=auto' + +# Colorize `grep` output +alias grep='grep --color=auto' + +# Change layout of lsblk to include FSTYPE and remove MAJ:MIN, RM, and RO collumns. +alias lsblk='lsblk -o NAME,FSTYPE,SIZE,TYPE,MOUNTPOINT' + +# Always use sudo when using systemctl. Pairs well with passwordless sudo for systemctl. +alias systemctl='sudo --preserve-env systemctl'