Last active
October 30, 2018 17:59
-
-
Save theironsamurai/c5c53e013f3a0de371fc to your computer and use it in GitHub Desktop.
My Bash config - added to bottom of distro defaults
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#################################################### | |
########### My Bash Extras ######################## | |
#################################################### | |
##### Add to the bottom of the .bashrc | |
BROWSER=/usr/bin/firefox | |
EDITOR=/usr/bin/vim | |
export PATH="$PATH:$HOME/.local/bin" | |
export PATH="$HOME/bin:$PATH" | |
# Ruby | |
#export PATH="$HOME/.rbenv/bin:$PATH" | |
#eval "$(rbenv init -)" | |
# User specific aliases and functions | |
# Super-Spy Aliases! | |
alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F' | |
alias ll='ls -l --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F' | |
alias la='ls -la --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F' | |
alias grep='grep --color=tty -d skip' | |
alias cp="cp -i" # confirm before overwriting something | |
alias df='df -h' # human-readable sizes | |
alias free='free -m' # show sizes in MB | |
alias sbash="source ~/.bashrc" | |
# Emacs | |
alias etp='emacsclient -t PKGBUILD' | |
alias ee="emacsclient -nw" | |
alias et="emacsclient -t" | |
alias ec="emacsclient -c" | |
alias demacs="emacs --daemon" | |
alias kemacs="emacsclient -e '(kill-emacs)'" | |
alias etb="et .bashrc" | |
alias E="SUDO_EDITOR=\"emacsclient -t -a emacs\" sudoedit" | |
# Dir | |
alias cdhome="cd ~/" | |
alias cdh="cd ~/" | |
alias cdb="cd .." | |
alias cdbb="cd ../.." | |
alias cdbbb="cd ../../.." | |
alias cdbbbb="cd ../../../.." | |
alias cdspace="cd ~/.spacemacs.d" | |
alias cdgollum="cd ~/Dropbox/gollum" | |
alias cdbooks="cd ~/Dropbox/Books" | |
alias cdwiki="cd ~/Dropbox/sites/ironwiki" | |
alias cdwikidata="cd ~/Dropbox/sites/ironwiki/wikidata" | |
alias vimbash="vim ~/.bashrc" | |
alias cdsites="cd ~/Dropbox/sites" | |
# Git & wikis | |
alias gitlazy="git add --all && git commit -m 'lazy commit' && git push" | |
alias gitorg="cd ~/Dropbox/orgwiki && git add --all && git commit -m 'lazy commit'" | |
alias gitorgpush="cd ~/Dropbox/orgwiki && git push" | |
alias gitwiki="cd ~/Dropbox/sites/ironwiki/wikidata && git add --all && git commit -m 'lazy wiki commit' && git push && cd ~" | |
alias gitbooks="git add --all && git commit -m 'lazy books commit' && git push" | |
alias rungollum="cd ~/Dropbox/gollum && gollum --mathjax --css --config config.rb" | |
alias runwiki="cd ~/Dropbox/sites/ironwiki && gitit -f my.conf" | |
alias killfinder="ps -ax | grep " ### Add search term (for instance: instiki) | |
alias ggg="git add . && git commit -m 'lazy'" | |
# ex - archive extractor | |
# usage: ex <file> | |
ex () | |
{ | |
if [ -f $1 ] ; then | |
case $1 in | |
*.tar.bz2) tar xjf $1 ;; | |
*.tar.gz) tar xzf $1 ;; | |
*.bz2) bunzip2 $1 ;; | |
*.rar) unrar x $1 ;; | |
*.gz) gunzip $1 ;; | |
*.tar) tar xf $1 ;; | |
*.tbz2) tar xjf $1 ;; | |
*.tgz) tar xzf $1 ;; | |
*.zip) unzip $1 ;; | |
*.Z) uncompress $1;; | |
*.7z) 7z x $1 ;; | |
*) echo "'$1' cannot be extracted via ex()" ;; | |
esac | |
else | |
echo "'$1' is not a valid file" | |
fi | |
} | |
# CUSTOM BASH COLOR PROMPT | |
# 30m - Black | |
# 31m - Red | |
# 32m - Green | |
# 33m - Yellow | |
# 34m - Blue | |
# 35m - Purple | |
# 36m - Cyan | |
# 37m - White | |
# 0 - Normal | |
# 1 - Bold | |
function prompt { | |
local BLACK="\[\033[0;30m\]" | |
local BLACKBOLD="\[\033[1;30m\]" | |
local RED="\[\033[0;31m\]" | |
local REDBOLD="\[\033[1;31m\]" | |
local GREEN="\[\033[0;32m\]" | |
local GREENBOLD="\[\033[1;32m\]" | |
local YELLOW="\[\033[0;33m\]" | |
local YELLOWBOLD="\[\033[1;33m\]" | |
local BLUE="\[\033[0;34m\]" | |
local BLUEBOLD="\[\033[1;34m\]" | |
local PURPLE="\[\033[0;35m\]" | |
local PURPLEBOLD="\[\033[1;35m\]" | |
local CYAN="\[\033[0;36m\]" | |
local CYANBOLD="\[\033[1;36m\]" | |
local WHITE="\[\033[0;37m\]" | |
local WHITEBOLD="\[\033[1;37m\]" | |
export PS1="\n$YELLOWBOLD\u @ \h\n$GREENBOLD \@:$REDBOLD[\w]$CYANBOLD λ: \[\033[00m\] " | |
} | |
prompt | |
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change. | |
export PATH="$PATH:$HOME/.rvm/bin" | |
#neofetch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment