2017-12-15 15:02:16 -07:00
|
|
|
if [[ -n "$(echo $SHELL | grep zsh)" ]]; then
|
2017-10-19 23:00:27 -07:00
|
|
|
export ZSH="$HOME/.oh-my-zsh"
|
2017-09-28 10:22:57 -07:00
|
|
|
|
|
|
|
ZSH_THEME="jispwoso"
|
|
|
|
|
|
|
|
plugins=(git)
|
2017-10-19 23:00:27 -07:00
|
|
|
source "$ZSH/oh-my-zsh.sh"
|
2017-09-28 10:22:57 -07:00
|
|
|
fi
|
|
|
|
|
2017-12-15 15:02:16 -07:00
|
|
|
if [[ -d "$HOME/devel" ]]; then
|
|
|
|
export DEVPATH="$HOME/devel"
|
|
|
|
else
|
|
|
|
export DEVPATH="$HOME"
|
2017-09-28 10:22:57 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -d "$DEVPATH/android/android-sdk" ]]; then
|
2017-10-19 23:00:27 -07:00
|
|
|
export ANDROID_SDK="$HOME/dev/android/android-sdk"
|
2017-09-28 10:22:57 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -d "$DEVPATH/android/android-ndk" ]]; then
|
2017-10-19 23:00:27 -07:00
|
|
|
export ANDROID_NDK="$HOME/dev/android/android-ndk"
|
2017-09-28 10:22:57 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
which go &> /dev/null
|
2017-10-19 22:54:42 -07:00
|
|
|
if (( !$? )) && [[ -d "$DEVPATH/go" ]]; then
|
|
|
|
export GOPATH="$DEVPATH/go"
|
2017-12-21 19:15:57 -07:00
|
|
|
export PATH="$GOPATH/bin:$PATH"
|
2017-09-28 10:22:57 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
function passgen () {
|
2017-10-31 16:57:45 -07:00
|
|
|
local len="$1"
|
|
|
|
local lower="$2"
|
2017-09-28 10:22:57 -07:00
|
|
|
|
2017-12-27 16:40:08 -07:00
|
|
|
echo "$len" | grep -qE '^[0-9]+$'
|
2017-12-15 15:12:37 -07:00
|
|
|
if (( $? )); then
|
2017-09-28 10:22:57 -07:00
|
|
|
len=32
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$lower" = "true" ]]; then
|
|
|
|
local tr1="[:upper:]"
|
|
|
|
local tr2="[:lower:]"
|
|
|
|
fi
|
|
|
|
|
2017-12-15 15:12:37 -07:00
|
|
|
cat /dev/urandom | base64 | head -c "$len" | tr -d "\n" | \
|
2017-09-28 10:22:57 -07:00
|
|
|
tr "$tr1" "$tr2" && echo
|
|
|
|
}
|
|
|
|
|
2017-10-31 16:53:38 -07:00
|
|
|
which nvim &> /dev/null
|
|
|
|
neovim="$?"
|
|
|
|
|
|
|
|
which vim &> /dev/null
|
|
|
|
vim="$?"
|
|
|
|
|
|
|
|
if (( !$neovim )); then
|
|
|
|
export EDITOR="nvim"
|
|
|
|
elif (( !$vim )); then
|
|
|
|
export EDITOR="vim"
|
|
|
|
else
|
|
|
|
export EDITOR="vi"
|
|
|
|
fi
|
|
|
|
|
2017-12-15 15:02:16 -07:00
|
|
|
if [[ -f "$HOME/.ssh-sentinel.sh" ]]; then
|
|
|
|
source "$HOME/.ssh-sentinel.sh"
|
|
|
|
fi
|
|
|
|
|
2017-10-31 16:54:09 -07:00
|
|
|
alias e="$EDITOR"
|
|
|
|
alias s="du -sh"
|
2017-09-28 10:22:57 -07:00
|
|
|
|
|
|
|
alias l="ls -lah"
|
|
|
|
alias ll="ls -lh"
|
|
|
|
alias la="ls -lah"
|