This commit is contained in:
Andrey Anurin
2016-05-16 23:46:33 -07:00
commit 916d13f93e
412 changed files with 37846 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
Configuration Files
===================
Zsh has several system-wide and user-local configuration files.
Prezto has one user-local configuration file.
System-wide configuration files are installation-dependent but are installed
in */etc* by default.
User-local configuration files have the same name as their global counterparts
but are prefixed with a dot (hidden). Zsh looks for these files in the path
stored in the `$ZDOTDIR` environmental variable. However, if said variable is
not defined, Zsh will use the user's home directory.
File Descriptions
-----------------
The configuration files are read in the following order:
01. /etc/zshenv
02. ~/.zshenv
03. /etc/zprofile
04. ~/.zprofile
05. /etc/zshrc
06. ~/.zshrc
07. ~/.zpreztorc
08. /etc/zlogin
09. ~/.zlogin
10. ~/.zlogout
11. /etc/zlogout
### zshenv
This file is sourced by all instances of Zsh, and thus, it should be kept as
small as possible and should only define environment variables.
### zprofile
This file is similar to zlogin, but it is sourced before zshrc. It was added
for [KornShell][1] fans. See the description of zlogin below for what it may
contain.
zprofile and zlogin are not meant to be used concurrently but can be done so.
### zshrc
This file is sourced by interactive shells. It should define aliases,
functions, shell options, and key bindings.
### zpreztorc
This file configures Prezto.
### zlogin
This file is sourced by login shells after zshrc, and thus, it should contain
commands that need to execute at login. It is usually used for messages such as
[fortune][2], [msgs][3], or for the creation of files.
This is not the file to define aliases, functions, shell options, and key
bindings. It should not change the shell environment.
### zlogout
This file is sourced by login shells during logout. It should be used for
displaying messages and the deletion of files.
Authors
-------
*The authors of these files should be contacted via the [issue tracker][4].*
- [Sorin Ionescu](https://github.com/sorin-ionescu)
[1]: http://www.kornshell.com
[2]: http://en.wikipedia.org/wiki/Fortune_(Unix)
[3]: http://www.manpagez.com/man/1/msgs
[4]: https://github.com/sorin-ionescu/prezto/issues

15
.zprezto/runcoms/zlogin Normal file
View File

@@ -0,0 +1,15 @@
#
# 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
} &!

13
.zprezto/runcoms/zlogout Normal file
View File

@@ -0,0 +1,13 @@
#
# Executes commands at logout.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
# Print the message.
cat <<-EOF
Thank you. Come again!
-- Dr. Apu Nahasapeemapetilon
EOF

174
.zprezto/runcoms/zpreztorc Normal file
View File

@@ -0,0 +1,174 @@
#
# Sets Prezto options.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# General
#
# Set case-sensitivity for completion, history lookup, etc.
# zstyle ':prezto:*:*' case-sensitive 'yes'
# Color output (auto set to 'no' on dumb terminals).
zstyle ':prezto:*:*' color 'yes'
# Set the Zsh modules to load (man zshmodules).
# zstyle ':prezto:load' zmodule 'attr' 'stat'
# Set the Zsh functions to load (man zshcontrib).
# zstyle ':prezto:load' zfunction 'zargs' 'zmv'
# Set the Prezto modules to load (browse modules).
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'editor' \
'history' \
'directory' \
'spectrum' \
'utility' \
'ssh' \
'completion' \
'homebrew' \
'osx' \
'ruby' \
'rails' \
'git' \
'syntax-highlighting' \
'history-substring-search' \
'prompt'
#
# Autosuggestions
#
# Set the query found color.
# zstyle ':prezto:module:autosuggestions:color' found ''
#
# Editor
#
# Set the key mapping style to 'emacs' or 'vi'.
zstyle ':prezto:module:editor' key-bindings 'emacs'
# Auto convert .... to ../..
# zstyle ':prezto:module:editor' dot-expansion 'yes'
#
# Git
#
# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'.
# zstyle ':prezto:module:git:status:ignore' submodules 'all'
#
# GNU Utility
#
# Set the command prefix on non-GNU systems.
# zstyle ':prezto:module:gnu-utility' prefix 'g'
#
# History Substring Search
#
# Set the query found color.
# zstyle ':prezto:module:history-substring-search:color' found ''
# Set the query not found color.
# zstyle ':prezto:module:history-substring-search:color' not-found ''
# Set the search globbing flags.
# zstyle ':prezto:module:history-substring-search' globbing-flags ''
#
# Pacman
#
# Set the Pacman frontend.
# zstyle ':prezto:module:pacman' frontend 'yaourt'
#
# Prompt
#
# Set the prompt theme to load.
# Setting it to 'random' loads a random theme.
# Auto set to 'off' on dumb terminals.
#zstyle ':prezto:module:prompt' theme 'sorin'
zstyle ':prezto:module:prompt' theme 'abra'
#
# Ruby
#
# Auto switch the Ruby version on directory change.
# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes'
#
# Screen
#
# Auto start a session when Zsh is launched in a local terminal.
# zstyle ':prezto:module:screen:auto-start' local 'yes'
# Auto start a session when Zsh is launched in a SSH connection.
# zstyle ':prezto:module:screen:auto-start' remote 'yes'
#
# SSH
#
# Set the SSH identities to load into the agent.
# zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github'
#
# Syntax Highlighting
#
# Set syntax highlighters.
# By default, only the main highlighter is enabled.
# zstyle ':prezto:module:syntax-highlighting' highlighters \
# 'main' \
# 'brackets' \
# 'pattern' \
# 'line' \
# 'cursor' \
# 'root'
#
# Set syntax highlighting styles.
# zstyle ':prezto:module:syntax-highlighting' styles \
# 'builtin' 'bg=blue' \
# 'command' 'bg=blue' \
# 'function' 'bg=blue'
#
# Terminal
#
# Auto set the tab and window titles.
# zstyle ':prezto:module:terminal' auto-title 'yes'
# Set the window title format.
# zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s'
# Set the tab title format.
# zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
#
# Tmux
#
# Auto start a session when Zsh is launched in a local terminal.
# zstyle ':prezto:module:tmux:auto-start' local 'yes'
# Auto start a session when Zsh is launched in a SSH connection.
# zstyle ':prezto:module:tmux:auto-start' remote 'yes'
# Integrate with iTerm2.
zstyle ':prezto:module:tmux:iterm' integrate 'yes'

79
.zprezto/runcoms/zprofile Normal file
View File

@@ -0,0 +1,79 @@
#
# 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='nano'
export VISUAL='nano'
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"
# Setting PATH for Python 3.5
# The orginal version is saved in .zprofile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH

11
.zprezto/runcoms/zshenv Normal file
View File

@@ -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

122
.zprezto/runcoms/zshrc Normal file
View File

@@ -0,0 +1,122 @@
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
unsetopt CORRECT
# Now we can pipe to multiple outputs!
setopt MULTIOS
# This makes cd=pushd
setopt AUTO_PUSHD
# This will use named dirs when possible
setopt AUTO_NAME_DIRS
# If we have a glob this will expand it
setopt GLOB_COMPLETE
# use magic (this is default, but it can't hurt!)
setopt ZLE
setopt NO_HUP
# setopt IGNORE_EOF
# If I could disable Ctrl-s completely I would!
setopt NO_FLOW_CONTROL
unsetopt normstarsilent
## Keep echo "station" > station from clobbering station
#setopt NO_CLOBBER
setopt CLOBBER
# No ! voodoo
unsetopt bang_hist
# Case insensitive globbing
setopt NO_CASE_GLOB
# Be Reasonable!
setopt NUMERIC_GLOB_SORT
# I don't know why I never set this before.
setopt EXTENDED_GLOB
# hows about arrays be awesome? (that is, frew${cool}frew has frew surrounding all the variables, not just first and last
setopt RC_EXPAND_PARAM
# Who doesn't want home and end to work?
bindkey '\e[1~' beginning-of-line
bindkey '\e[4~' end-of-line
bindkey "\eOH" beginning-of-line
bindkey "\eOF" end-of-line
# --------------------------------------- ALIASES --------------------------------------------------
# aliases
alias g="git"
alias a="git add --all :/"
alias b="git branch"
alias c="git commit -am"
alias ch="git checkout"
alias pull="git pull"
# alias m="git merge --no-ff"
alias rb="git reset HEAD --hard"
alias s="git status"
alias st="git stash"
alias g5="git5"
alias e="git5 export"
alias m="git5 merge --no-ff"
alias ma="git5 mail -m"
alias push="git5 submit -xy"
# alias push="git submit -xy"
alias dc="a && c \"dummy comment\""
alias zshconfig="subl ~/.zshrc"
alias zshreload="exec zsh"
alias tarc="tar cvzf"
alias rcp="rsync --partial --progress --append --rsh=ssh -r -h"
alias rmv="rsync --partial --progress --append --rsh=ssh -r -h --remove-sent-files"
alias pythonserve="sudo python -m SimpleHTTPServer 80"
# replace
alias sg='perl -0pe'
alias clbin="curl -F 'clbin=<-' https://clbin.com"
alias afs="unmount-abra0; mount-abra0;"
alias dotgit='git --git-dir=$HOME/.dotgit/ --work-tree=$HOME'
function dotgit-init() {
git init --bare $HOME/.dotgit
dotgit config --local status.showUntrackedFiles no
}
function twitch() {
livestreamer "http://www.twitch.tv/$1" source &!
}
function is_local() {
[[ $(hostname) == "abra0.local" ]]
}
function make_user() {
if is_local; then
echo "You're local"
return 1
fi
adduser --system --shell /bin/zsh --disabled-password $1 || return 1
wget abra.me/.dotfiles.tar.gz -O /home/$1/.dotfiles.tar.gz
tar xf /home/$1/.dotfiles.tar.gz -C /home/$1
chown $1:nogroup -R /home/$1/
}
fucntion hihi() {
cd a
}
# ----------------------------------- END ALIASES --------------------------------------------------
export EDITOR=/usr/bin/vim
export PATH=$PATH:$HOME/bin:$HOME/brew/bin
# added by travis gem
[ -f /Users/abra/.travis/travis.sh ] && source /Users/abra/.travis/travis.sh