From 32caf9903d32fa981abb217f1164a4aba824dce0 Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Thu, 28 Sep 2017 10:22:57 -0700 Subject: [PATCH] Profile --- profile | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ zshrc | 40 +--------------------------------------- 2 files changed, 56 insertions(+), 39 deletions(-) create mode 100644 profile diff --git a/profile b/profile new file mode 100644 index 0000000..f14a91e --- /dev/null +++ b/profile @@ -0,0 +1,55 @@ +export DEVPATH=$HOME/dev + +if [[ -n "$(echo $SHELL | grep zsh)" ]]; then + export ZSH=$HOME/.oh-my-zsh + + ZSH_THEME="jispwoso" + + plugins=(git) + source $ZSH/oh-my-zsh.sh +fi + +if [[ -d "$HOME/.rvm" ]]; then + export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting + + [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* +fi + +if [[ -d "$DEVPATH/android/android-sdk" ]]; then + export ANDROID_SDK=$HOME/dev/android/android-sdk +fi + +if [[ -d "$DEVPATH/android/android-ndk" ]]; then + export ANDROID_NDK=$HOME/dev/android/android-ndk +fi + +which go &> /dev/null +if (( !$? )); then + export GOPATH=$DEVPATH/go +fi + +function passgen () { + local len=$1 + local lower=$2 + + echo $len | grep -q '^[0-9]+$' + if (( ! $? )); then + len=32 + fi + + if [[ "$lower" = "true" ]]; then + local tr1="[:upper:]" + local tr2="[:lower:]" + fi + + cat /dev/urandom | base64 | head -c $len | tr -d "\n" | \ + tr "$tr1" "$tr2" && echo +} + +export EDITOR='nvim' + +alias l="ls -lah" +alias ll="ls -lh" +alias la="ls -lah" + +source $HOME/.ssh-sentinel.sh diff --git a/zshrc b/zshrc index 9dc6c09..70bd631 100644 --- a/zshrc +++ b/zshrc @@ -1,39 +1 @@ -# Path to your oh-my-zsh installation. -export ZSH=$HOME/.oh-my-zsh - -# Set name of the theme to load. Optionally, if you set this to "random" -# it'll load a random theme each time that oh-my-zsh is loaded. -# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes -ZSH_THEME="jispwoso" - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=(git) - -source $ZSH/oh-my-zsh.sh - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -export EDITOR='nvim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting - -[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" - -export ANDROID_SDK=$HOME/dev/android/android-sdk -export ANDROID_NDK=$HOME/dev/android/android-ndk-r13b -export GOPATH=$HOME/dev/go - -alias l="ls -la" -alias ll="ls -l" -alias la="ls -la" -alias zshconfig="$EDITOR ~/.zshrc" -alias ohmyzsh="$EDITOR ~/.oh-my-zsh" +source $HOME/.profile