-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc_ssh
58 lines (50 loc) · 1.22 KB
/
.bashrc_ssh
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
if [[ $OSTYPE == "linux-gnu" ]]; then
# check if ssh session
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
export DISPLAY=":0"
fi
# append to the history file, don't overwrite it
shopt -s histappend
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias rlg='source ~/.bashrc'
# caps lock nonsense
alias CAPSLOCK='xdotool key Caps_Lock'
# ERGMG FZF
FZFDIR=${HOME}/.fzf
if [ ! -d "${FZFDIR}" ]; then
git clone https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install --all
fi
export FZF_DEFAULT_OPTS='--bind=ctrl-u:half-page-up,ctrl-d:half-page-down,ctrl-b:page-up,ctrl-f:page-down'
elif [[ $OSTYPE == "darwin"* ]]; then
alias ls='gls --color=auto'
alias grep='ggrep --color=auto'
alias dircolors='gdircolors'
alias rlg='source ~/.bash_profile'
fi
# aliases
alias ll='ls -lh'
alias l='ls -lh'
alias lll='ls -lh'
alias la='ls -lsah'
alias gits='git status'
alias cld='cdl'
alias gitb='git branch -vv'
alias vf='vim $(fzf)'
# cd and ls
function cdl ()
{
if [ $# == 0 ]
then
cd && ls -lh
else
cd "$1" && ls -lh
fi
}
function cdu() {
if [[ "$#" -gt 0 ]] ; then
cd $(printf "%0.s../" $(seq 1 $1 ));
ls -lh
fi
}