-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
79 lines (62 loc) · 2.13 KB
/
Copy path.bashrc
File metadata and controls
79 lines (62 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# ~/.bashrc
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
stty -echoctl
# term initializations
PS1="\[\e[0;1;34m\][\$(date +%R)] \[\e[00;01;35m\]${chroot:+($chroot)}\u@\h\[\e[01;34m\]:\w\[\e[01;31m\] \$ "
echo -e "\x1b[1;1H\x1b[J"
echo "There are $(users | wc -w) users logged in."
if command_exists lolcat; then
echo "Logged in as $(whoami)" | lolcat
else
echo "Logged in as $(whoami)"
fi
echo -e "\n$(pwd)\n"
# hard screen clear
bind -x '"\C-t": printf "\ec"'
# ls options
alias l='ls'
alias la='ls -AFG'
alias ll='ls -lAFG'
alias cl='clear; ls -G'
alias cls='clear; ls -AG'
alias cll='clear; ll -G'
alias clll='clear; ll | less'
alias ld='clear; ls -1v '
# grep options
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# vim aliases
alias vb='vim ~/.bashrc && source ~/.bashrc'
alias vv='vim ~/.vimrc'
#mistake aliases
alias cim='vim'
alias vmi='vim'
# edit aliases
alias obr='open -e ~/.bashrc && source ~/.bashrc'
alias ovr='open -e ~/.vimrc'
alias oe='open -e'
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# append to the history file, don't overwrite it
shopt -s histappend
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# alerts
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias emergency='notify-send --urgency=critical -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
#general aliases
alias c='clear'
# mariadb
alias sql_connect='mysql -u $(whoami) -p -h ember-db'
#methods
weather(){
curl -s "http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=${@:-33805}"|perl -ne '/<title>([^<]+)/&&printf "%s: ",$1;/<fcttext>([^<]+)/&&print $1,"\n"';
} # FPU zip code
command_exists () { #to see if a program is installed
type "$1" &> /dev/null ;
}
# Mail var for vim header
export MAIL=$(whoami)@floridapoly.edu