abra zsh config 2.0

This commit is contained in:
Andrey Anurin
2018-08-12 15:26:21 +03:00
parent 201abd09c4
commit 6b114440e2
1195 changed files with 68948 additions and 10539 deletions

View File

@@ -1,62 +0,0 @@
# ===== 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 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 dcp="a; dc; git push"
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 rsyncc="rsync -rzPhc"
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 .g='git --git-dir=$HOME/.dotgit/ --work-tree=$HOME'
alias .gs='.g status -uno'
alias .gp='.g commit -am "auto" && .g push'
alias p="perl -pe"
alias p0="perl -0pe"
alias -g LATEST='*(om[1])'
#alias f1sql="/google/data/ro/projects/storage/f1/tools/f1-sql"
#alias t="task"
#alias revs="ssh abra0 'tail -f -n0 ~/reverse_shell' | tee -a .rem_history| zsh -s"
#alias nika_pop="echo \"afplay ~/tmp/nika.mp3\" > ~/reverse_shell"
# remote tmux on server
alias tmuxr="tmux new -ADs auto-session"
# ===== FUNCTIONS =====
alias FUNCTION_PRELUDE="setopt LOCAL_OPTIONS PIPE_FAIL XTRACE ERR_RETURN"

View File

@@ -15,6 +15,9 @@
# Color output (auto set to 'no' on dumb terminals).
zstyle ':prezto:*:*' color 'yes'
# Add additional directories to load prezto modules from
# zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib
# Set the Zsh modules to load (man zshmodules).
# zstyle ':prezto:load' zmodule 'attr' 'stat'
@@ -31,17 +34,14 @@ zstyle ':prezto:load' pmodule \
'directory' \
'spectrum' \
'utility' \
'ssh' \
'completion' \
'prompt' \
'ssh' \
'homebrew' \
'osx' \
'ruby' \
'rails' \
'git' \
'syntax-highlighting' \
'history-substring-search' \
'prompt' \
'zbell'
'history-substring-search'
#
# Autosuggestions
@@ -50,6 +50,14 @@ zstyle ':prezto:load' pmodule \
# Set the query found color.
# zstyle ':prezto:module:autosuggestions:color' found ''
#
# Completions
#
# Set the entries to ignore in static */etc/hosts* for host completion.
# zstyle ':prezto:module:completion:*:hosts' etc-host-ignores \
# '0.0.0.0' '127.0.0.1'
#
# Editor
#
@@ -60,6 +68,9 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
# Auto convert .... to ../..
# zstyle ':prezto:module:editor' dot-expansion 'yes'
# Allow the zsh prompt context to be shown.
#zstyle ':prezto:module:editor' ps-context 'yes'
#
# Git
#
@@ -87,6 +98,13 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
# Set the search globbing flags.
# zstyle ':prezto:module:history-substring-search' globbing-flags ''
#
# macOS
#
# Set the keyword used by `mand` to open man pages in Dash.app
# zstyle ':prezto:module:osx:man' dash-keyword 'manpages'
#
# Pacman
#
@@ -101,9 +119,17 @@ zstyle ':prezto:module:editor' key-bindings 'emacs'
# 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'
# Set the working directory prompt display length.
# By default, it is set to 'short'. Set it to 'long' (without '~' expansion)
# for longer or 'full' (with '~' expansion) for even longer prompt display.
# zstyle ':prezto:module:prompt' pwd-length 'short'
# Set the prompt to display the return code along with an indicator for non-zero
# return codes. This is not supported by all prompts.
# zstyle ':prezto:module:prompt' show-return-val 'yes'
#
# Ruby
#
@@ -111,6 +137,16 @@ zstyle ':prezto:module:prompt' theme 'abra'
# Auto switch the Ruby version on directory change.
# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes'
#
# Python
#
# Auto switch the Python virtualenv on directory change.
# zstyle ':prezto:module:python:virtualenv' auto-switch 'yes'
# Automatically initialize virtualenvwrapper if pre-requisites are met.
# zstyle ':prezto:module:python:virtualenv' initialize 'yes'
#
# Screen
#
@@ -147,6 +183,10 @@ zstyle ':prezto:module:prompt' theme 'abra'
# 'builtin' 'bg=blue' \
# 'command' 'bg=blue' \
# 'function' 'bg=blue'
#
# Set syntax pattern styles.
# zstyle ':prezto:module:syntax-highlighting' pattern \
# 'rm*-rf*' 'fg=white,bold,bg=red'
#
# Terminal
@@ -161,6 +201,9 @@ zstyle ':prezto:module:prompt' theme 'abra'
# Set the tab title format.
# zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
# Set the terminal multiplexer title format.
# zstyle ':prezto:module:terminal:multiplexer-title' format '%s'
#
# Tmux
#
@@ -174,3 +217,14 @@ zstyle ':prezto:module:prompt' theme 'abra'
# Integrate with iTerm2.
zstyle ':prezto:module:tmux:iterm' integrate 'yes'
# Set the default session name:
# zstyle ':prezto:module:tmux:session' name 'YOUR DEFAULT SESSION NAME'
#
# Utility
#
# Enabled safe options. This aliases cp, ln, mv and rm so that they prompt
# before deleting or overwriting files. Set to 'no' to disable this safer
# behavior.
# zstyle ':prezto:module:utility' safe-ops 'yes'

View File

@@ -36,7 +36,7 @@ fi
# Ensure path arrays do not contain duplicates.
typeset -gU cdpath fpath mailpath path
# Set the the list of directories that cd searches.
# Set the list of directories that cd searches.
# cdpath=(
# $cdpath
# )
@@ -61,15 +61,3 @@ export LESS='-F -g -i -M -R -S -w -X -z-4'
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"

View File

@@ -6,6 +6,16 @@
#
# Ensure that a non-login, non-interactive shell has a defined environment.
if [[ "$SHLVL" -eq 1 && ! -o LOGIN && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
if [[ ( "$SHLVL" -eq 1 && ! -o LOGIN ) && -s "${ZDOTDIR:-$HOME}/.zprofile" ]]; then
source "${ZDOTDIR:-$HOME}/.zprofile"
fi
function add_to_path {
if [[ -d $1 ]]; then
export PATH="$1:$PATH"
fi
}
add_to_path "$HOME/bin"
add_to_path "$HOME/brew/sbin"
add_to_path "$HOME/brew/bin"

View File

@@ -1,34 +1,17 @@
#
# Executes commands at the start of an interactive session.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
function zsource_if_exists {
if [[ -s "$1" ]]; then
source "$1"
fi
}
# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi
source ~/.zoptions
source ~/.zalias
source ~/.zfunc
if [[ -s "$HOME/.iterm2_shell_integration.zsh" ]]; then
source "$HOME/.iterm2_shell_integration.zsh"
fi
add_dir_to_path "$HOME/bin"
add_dir_to_path "$HOME/work/arcadia"
add_dir_to_path "$HOME/brew/sbin"
add_dir_to_path "$HOME/brew/bin"
# export PATH="$HOME/bin/":$PATH
# export PATH="$HOME/work/arcadia/":$PATH
# if is_local; then
# export PATH="$HOME/brew/sbin":"$HOME/brew/bin":$PATH
# export DYLD_LIBRARY_PATH="/Developer/NVIDIA/CUDA-8.0/lib:/usr/local/cuda/lib"
# fi
# update, background+disown
update_.g &!
zsource_if_exists "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
zsource_if_exists "${ZDOTDIR:-$HOME}/.zprezto/abra/main.zsh"