-
Notifications
You must be signed in to change notification settings - Fork 1
/
_bashrc
76 lines (65 loc) · 1.82 KB
/
_bashrc
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
# Some options for shell
shopt -s globstar nocaseglob
umask 0046
#umask 0066 # Restrictive for new files
#ulimit -n 2048
export HISTTIMEFORMAT="%m/%d/%y - %H:%M:%S "
export PATH=~/bin:~/opt/node/bin:$PATH
export CDPATH=.:~/Work/smartclientApps
set -o vi
# ssh-agent
#ssh-add -l &>/dev/null
#if [ "$?" == 2 ]; then
# test -r ~/.ssh-agent && eval "$(<~/.ssh-agent)" >/dev/null
#
# ssh-add -l &>/dev/null
# if [ "$?" == 2 ]; then
# (umask 066; ssh-agent > ~/.ssh-agent)
# eval "$(<~/.ssh-agent)" >/dev/null
# ssh-add
# fi
#fi
# Tmux session
if [[ -z $TMUX ]]; then
tmux new-session -As main
fi
# Useful functions
function lt {
ls -lt $* | head -n $(( ${LINES:-15} - 3 )); echo "..."
}
function cdt {
if [[ `pwd` == ${HOME}* && -n "$1" ]]; then
homeLength=${#HOME}
newPath=`echo ${PWD:$homeLength} | sed -e "s#\(\(/[^/]*\)\{$1\}\).*#\1#"`
cd $HOME$newPath
fi
}
function vii { file=$(find -type f | ([[ -z $1 ]] && cat || fgrep $1) | fzy) && vim $file; }
function cdi { dir=$(find $1 -type d | fzy) && cd $dir; }
function cdu { updir=$(a=''; for i in `pwd | tr / ' '`; do a=$a/$i; echo $a; done | fzy) && cd $updir; }
alias chf="find -type f | fzy"
alias chd="find -type d | fzy"
# Aliases
alias la='ls -la'
alias l='ls -l'
alias histsave="history -a"
alias histload="history -n"
alias cd2="cdt 2"
alias cd3="cdt 3"
alias cd4="cdt 4"
alias cd5="cdt 5"
alias cd6="cdt 6"
alias cd7="cdt 7"
alias cd8="cdt 8"
alias cd9="cdt 9"
# Additional options for other SW
export JAVA_HOME=/usr/lib/jvm/java-8-oracle/
export MAVEN_OPTS="-Xms300M -Xmx300M -XX:+TieredCompilation -XX:TieredStopAtLevel=1"
export LESS="-niSR"
export NODE_PATH="$(npm root -g)"
#export NODE_PATH=/usr/local/lib/node_modules
# For Eclipse/SWT
export SWT_GTK3=0;
# Machine settings
#pacmd set-card-profile 0 output:analog-stereo+input:analog-stereo
#pacmd set-default-sink 1