aboutsummaryrefslogtreecommitdiff
path: root/runcoms
diff options
context:
space:
mode:
Diffstat (limited to 'runcoms')
-rw-r--r--runcoms/zlogin25
-rw-r--r--runcoms/zlogout0
-rw-r--r--runcoms/zprofile74
-rw-r--r--runcoms/zshenv11
-rw-r--r--runcoms/zshrc64
5 files changed, 174 insertions, 0 deletions
diff --git a/runcoms/zlogin b/runcoms/zlogin
new file mode 100644
index 0000000..8af0975
--- /dev/null
+++ b/runcoms/zlogin
@@ -0,0 +1,25 @@
+#
+# Executes commands at login post-zshrc.
+#
+# Authors:
+# Sorin Ionescu <sorin.ionescu@gmail.com>
+#
+
+# Execute code that does not affect the current session in the background.
+{
+ # Compile the completion dump to increase startup speed.
+ zcompdump="${ZDOTDIR:-$HOME}/.zcompdump"
+ if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then
+ zcompile "$zcompdump"
+ fi
+} &!
+
+# Print a random, hopefully interesting, adage.
+if (( $+commands[fortune] )); then
+ echo -en "\033[30m"
+ if [[ -t 0 || -t 1 ]]; then
+ fortune -s
+ print
+ fi
+ echo -en "\033[m"
+fi
diff --git a/runcoms/zlogout b/runcoms/zlogout
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/runcoms/zlogout
diff --git a/runcoms/zprofile b/runcoms/zprofile
new file mode 100644
index 0000000..b18b307
--- /dev/null
+++ b/runcoms/zprofile
@@ -0,0 +1,74 @@
+#
+# Executes commands at login pre-zshrc.
+#
+# Authors:
+# Sorin Ionescu <sorin.ionescu@gmail.com>
+#
+
+#
+# Browser
+#
+
+if [[ "$OSTYPE" == darwin* ]]; then
+ export BROWSER='open'
+fi
+
+#
+# Editors
+#
+
+export EDITOR='vi'
+export VISUAL='vi'
+export PAGER='less'
+
+#
+# Language
+#
+
+if [[ -z "$LANG" ]]; then
+ export LANG='en_US.UTF-8'
+fi
+
+#
+# Paths
+#
+
+# Ensure path arrays do not contain duplicates.
+typeset -gU cdpath fpath mailpath path
+
+# Set the the list of directories that cd searches.
+# cdpath=(
+# $cdpath
+# )
+
+# Set the list of directories that Zsh searches for programs.
+path=(
+ /usr/local/{bin,sbin}
+ $path
+)
+
+#
+# Less
+#
+
+# Set the default Less options.
+# Mouse-wheel scrolling has been disabled by -X (disable screen clearing).
+# Remove -X and -F (exit if the content fits on one screen) to enable it.
+export LESS='-F -g -i -M -R -S -w -X -z-4'
+
+# Set the Less input preprocessor.
+# Try both `lesspipe` and `lesspipe.sh` as either might exist on a system.
+if (( $#commands[(i)lesspipe(|.sh)] )); then
+ export LESSOPEN="| /usr/bin/env $commands[(i)lesspipe(|.sh)] %s 2>&-"
+fi
+
+#
+# Temporary Files
+#
+
+if [[ ! -d "$TMPDIR" ]]; then
+ export TMPDIR="/tmp/$LOGNAME"
+ mkdir -p -m 700 "$TMPDIR"
+fi
+
+TMPPREFIX="${TMPDIR%/}/zsh"
diff --git a/runcoms/zshenv b/runcoms/zshenv
new file mode 100644
index 0000000..2d97203
--- /dev/null
+++ b/runcoms/zshenv
@@ -0,0 +1,11 @@
+#
+# Defines environment variables.
+#
+# Authors:
+# Sorin Ionescu <sorin.ionescu@gmail.com>
+#
+
+# Ensure that a non-login, non-interactive shell has a defined environment.
+if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
+ source "${ZDOTDIR:-$HOME}/.zprofile"
+fi
diff --git a/runcoms/zshrc b/runcoms/zshrc
new file mode 100644
index 0000000..189c40d
--- /dev/null
+++ b/runcoms/zshrc
@@ -0,0 +1,64 @@
+################################################################################
+# Load Functions
+################################################################################
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/git-info.zsh"
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/dotenv.zsh"
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/graphviz.zsh"
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/functions/short-uptime.zsh"
+
+################################################################################
+# Load Modules
+################################################################################
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/environment.zsh"
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/editor.zsh"
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/history.zsh"
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/directory.zsh"
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/prompt.zsh"
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/vendor/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/completion.zsh"
+source "${ZDOTDIR:-$HOME}/.dotfiles/zsh/modules/aliases.zsh"
+
+################################################################################
+# ENV VARIABLES
+################################################################################
+# Terminal related
+export TERM=xterm-256color-italic
+
+# Paths
+# export JAVA_HOME=$(/usr/libexec/java_home) # Enable if using JDK, otherwise disable for performance
+export GOPATH=$HOME/Projects/go
+export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
+export ANDROID_HOME=$HOME/Library/Android/sdk
+export ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk-bundle
+export NVM_DIR=$HOME/.nvm
+export PATH=/usr/local/bin:/usr/local/sbin:$PATH
+export PATH=$PATH:$HOME/Library/Python/2.7/bin
+export PATH=$PATH:$HOME:/usr/local/opt/go/libexec/bin:${GOPATH//://bin:}/bin
+export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_NDK_HOME:/Applications/calibre.app/Contents/MacOS
+
+# Editor.
+export EDITOR="vim"
+export VISUAL="vim"
+
+# Python related variables
+export VIRTUAL_ENV_DISABLE_PROMPT=1
+export WORKON_HOME=$HOME/.virtualenvs
+export PROJECT_HOME=$HOME/Projects
+export VIRTUALENVWRAPPER_PYTHON="/usr/local/bin/python"
+
+# GPG
+export GPG_TTY=$(tty)
+
+# FZF Config
+export FZF_DEFAULT_COMMAND='/usr/local/bin/rg --color never --files --hidden -g \!.git'
+export FZF_DEFAULT_OPTS='--preview ''bat --style=numbers --color=always {} | head -500'''
+
+################################################################################
+# SECRET ENV VARS!!
+################################################################################
+
+if [[ -s "${ZDOTDIR:-$HOME}/.secrets.zsh" ]]; then
+ source "${ZDOTDIR:-$HOME}/.secrets.zsh"
+fi
+
+eval $(/usr/libexec/path_helper -s)