From 409b49dedfc94d81e5459d36c0d6df279e0a6c8f Mon Sep 17 00:00:00 2001 From: Allan MacGregor Date: Sat, 28 Jan 2017 12:11:07 -0500 Subject: [PATCH] Refactor of the ZSH Files --- .gitignore | 1 + zsh_files/functions.zsh | 15 +++++ zsh_files/variables.zsh | 23 +++++++ zshrc | 133 +++++++++++----------------------------- 4 files changed, 75 insertions(+), 97 deletions(-) create mode 100644 .gitignore create mode 100644 zsh_files/functions.zsh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c27b4fa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +vim/bundles/* diff --git a/zsh_files/functions.zsh b/zsh_files/functions.zsh new file mode 100644 index 0000000..e851c61 --- /dev/null +++ b/zsh_files/functions.zsh @@ -0,0 +1,15 @@ +########################################## +# Custom ZSH functions +########################################## + +# Man Command colorizer +man() { + env \ + LESS_TERMCAP_md=$'\e[1;36m' \ + LESS_TERMCAP_me=$'\e[0m' \ + LESS_TERMCAP_se=$'\e[0m' \ + LESS_TERMCAP_so=$'\e[1;40;92m' \ + LESS_TERMCAP_ue=$'\e[0m' \ + LESS_TERMCAP_us=$'\e[1;32m' \ + man "$@" +} diff --git a/zsh_files/variables.zsh b/zsh_files/variables.zsh index e0530ba..632e7a8 100644 --- a/zsh_files/variables.zsh +++ b/zsh_files/variables.zsh @@ -6,21 +6,44 @@ export EDITOR='vim' export HOMEBREW_NO_ANALYTICS=1 export JEKYLL_ENV=development +########################################## # NPM Varialbes +########################################## NPM_PACKAGES="$HOME/.npm-packages" NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH" +########################################## # Setting up the Paths +########################################## COMPOSERPATH="$HOME/.composer" TMUXIFIERPATH="$HOME/.tmuxifier" GOPATH="$HOME/go" +POWERLINE_PATH="$HOME/Projects/Utilities/powerline" +BASE16_SHELL="$HOME/.config/base16-shell/" +########################################## # Setting up the Bin Paths +########################################## GOBINPATH="$GOPATH/bin" COMPOSERBINPATH="$COMPOSERPATH/vendor/bin" NPMBINPATH="$NPM_PACKAGES/bin" TMUXIFIERBINPATH="$TMUXIFIERPATH/bin" HOMEBIN="$HOME/bin" +########################################## # Build and Export the PATH +########################################## export PATH="$GOBINPATH:$COMPOSERBINPATH:$TMUXIFIERBINPATH:$NPMBINPATH:$HOMEBIN:$PATH" + + +########################################## +# Experimental +########################################## +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# SSH +# export SSH_KEY_PATH="~/.ssh/dsa_id" + +# PHP-version switcher +# source $(brew --prefix php-version)/php-version.sh && php-version 5 diff --git a/zshrc b/zshrc index 79b18c5..bd79ee0 100644 --- a/zshrc +++ b/zshrc @@ -43,96 +43,24 @@ HIST_STAMPS="mm/dd/yyyy" # Example format: plugins=(rails git textmate ruby lighthouse) plugins=(brew git mix git-flow composer pyenv rake-fast python sudo aws debian docker git-extras) -source $ZSH/oh-my-zsh.sh +########################################## +# Load External configurationf files +########################################## + +# Load oh-my-zsh +if [ -e $ZSH/oh-my-zsh.sh ]; then + source $ZSH/oh-my-zsh.sh +fi # Load the secrets file if [ -e ~/.secrets ]; then source ~/.secrets fi - - -################## -# Session Variables -################## -##export PULSE_LATENCY_MSEC=30 -##export EDITOR='vim' -##export HOMEBREW_NO_ANALYTICS=1 -##export PATH="~/.composer/vendor/bin:/home/amacgregor/bin:$PATH" -##export PATH="/Users/amacgregor/anaconda/bin:$PATH" -##export GOPATH="/Users/amacgregor/go" -##export PATH=$GOPATH/bin:$PATH -##export PATH="$HOME/.tmuxifier/bin:$PATH" - -#export DOCKER_HOST=tcp://127.0.0.1:2376 -#export DOCKER_CERT_PATH=/Users/amacgregor/.dinghy/certs -#export DOCKER_TLS_VERIFY=1 - -#eval "$(rbenv init -)" -#export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH" -#export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH" - - -# export MANPATH="/usr/local/man:$MANPATH" - -# # Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -#if [[ -r ~/.local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh ]]; then -# source ~/.local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh -#fi - -# Load the powerline bindings -source /Users/amacgregor/Projects/Github/powerline/powerline/bindings/zsh/powerline.zsh - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# ssh -# export SSH_KEY_PATH="~/.ssh/dsa_id" - -# OPAM configuration -. /home/amacgregor/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh - - -#export PATH="$(brew --prefix homebrew/php/php54)/bin:$PATH" -##export PATH="/usr/local/bin/npm:$PATH" - -# Make Docker toolbox work -#eval "$(docker-machine env default)" -# - -# Vim mode -#bindkey -v -#export KEYTIMEOUT=1 - -#PHP-version switcher -#source $(brew --prefix php-version)/php-version.sh && php-version 5 - -# Run Fortune on a new terminal -fortune quotes - -# Base16 Shell -#BASE16_SHELL="$HOME/.config/base16-shell/base16-tomorrow.dark.sh" -#[[ -s $BASE16_SHELL ]] && source $BASE16_SHELL -# - -BASE16_SHELL=$HOME/.config/base16-shell/ -[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)" ] - -$HOME/.config/base16-shell/base16-tomorrow.dark.sh - -##NPM_PACKAGES=/Users/amacgregor/.npm-packages -##NODE_PATH="$NPM_PACKAGES/lib/node_modules:$NODE_PATH" -##PATH="$NPM_PACKAGES/bin:$PATH" - -test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh" - +# Load the FZF completion +if [ -e ~/.fzf.zsh ]; then + source ~/.fzf.zsh +fi # Load the Variables file if [ -e ~/.zsh_files/variables.zsh ]; then @@ -144,9 +72,19 @@ if [ -e ~/.zsh_files/aliases.zsh ]; then source ~/.zsh_files/aliases.zsh fi -######################### +# Load the Functions file +if [ -e ~/.zsh_files/functions.zsh ]; then + source ~/.zsh_files/functions.zsh +fi + +# Load the Powerline Bindings +if [ -e $POWERLINE_PATH/powerline/bindings/zsh/powerline.zsh ]; then + source $POWERLINE_PATH/powerline/bindings/zsh/powerline.zsh +fi + +########################################## # Environment setups -######################### +########################################## # Python with PyEnv setup if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi @@ -154,14 +92,15 @@ if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi # Ruby with RbEnv setup eval "$(rbenv init -)" -# Man Command colorizer -man() { - env \ - LESS_TERMCAP_md=$'\e[1;36m' \ - LESS_TERMCAP_me=$'\e[0m' \ - LESS_TERMCAP_se=$'\e[0m' \ - LESS_TERMCAP_so=$'\e[1;40;92m' \ - LESS_TERMCAP_ue=$'\e[0m' \ - LESS_TERMCAP_us=$'\e[1;32m' \ - man "$@" -} +# Color Scheme for Ruby // Requires Base16 Shell +$HOME/.config/base16-shell/base16-tomorrow.dark.sh + +########################################## +# Experimental +########################################## + +# OPAM configuration +#. /home/amacgregor/.opam/opam-init/init.zsh > /dev/null 2> /dev/null || true + +# Run Fortune on a new terminal +#fortune quotes