diff --git a/.zprezto/modules/prompt/functions/prompt_abra_setup b/.zprezto/modules/prompt/functions/prompt_abra_setup index 1a3ee65..6e76ed8 100644 --- a/.zprezto/modules/prompt/functions/prompt_abra_setup +++ b/.zprezto/modules/prompt/functions/prompt_abra_setup @@ -29,10 +29,7 @@ function prompt_abra_precmd { # Get Git repository information. if [[ -z $NOGIT ]] && (( $+functions[git-info] )); then - git-info on - git-info - else - git-info off + git-info || true fi PRE_LENGTH=$(($COLUMNS*2/3)) diff --git a/.zprezto/runcoms/zalias b/.zprezto/runcoms/zalias index d4677ff..e1fc190 100644 --- a/.zprezto/runcoms/zalias +++ b/.zprezto/runcoms/zalias @@ -1,19 +1,20 @@ +# ===== 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 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" @@ -22,16 +23,16 @@ 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 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 clbin="curl -F 'clbin=<-' https://clbin.com" #alias afs="unmount-abra0; mount-abra0;" @@ -39,10 +40,6 @@ alias .g='git --git-dir=$HOME/.dotgit/ --work-tree=$HOME' alias .gs='.g status -uno' alias .gp='.g commit -am "auto" && .g push' -# list disk usage -# alias dus="du -Hh -d 0 * .* | gsort -h" -alias dus="ncdu" - alias p="perl -pe" alias -g LATEST='*(om[1])' @@ -55,7 +52,10 @@ alias -g LATEST='*(om[1])' #alias nika_pop="echo \"afplay ~/tmp/nika.mp3\" > ~/reverse_shell" # remote tmux on server -alias tmuxr="tmux new -ADs mosh-session" +alias tmuxr="tmux new -ADs auto-session" + + +# ===== FUNCTIONS ===== function publish() { rsyncc $@ "dedi:/var/www/abra.me/list/" @@ -121,4 +121,56 @@ function rsync2() { function sync-music() { rsync2 --delete dedi:/home/torrent-user/music-library/ /Users/abra/music/library/ +} + +function .g-init() { + git init --bare $HOME/.dotgit + .g config --local status.showUntrackedFiles no + .g remote add origin ssh://dedi/root/.dotgit + git config --global user.name "Your Name" + git config --global user.email you@example.com + .g remote add origin ssh://dedi/var/www/git.abra.me/dot.git +} + +function is_local() { + [[ $(hostname) =~ '^abra0' ]] +} + +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/ +} + +function latest() { + echo -n ("${(@f)$(ls *(om[1,$1]))}") +} + +function testo() { + # set -eux + # set -o pipefail + + # set -exo pipefail + setopt ERR_RETURN + d + sadsa + + ls +} + +function testo2() { + # set -eux + # set -o pipefail + + # set -exo pipefail + sadsa + + ls } \ No newline at end of file diff --git a/.zprezto/runcoms/zprofile b/.zprezto/runcoms/zprofile index c061fde..44c2384 100644 --- a/.zprezto/runcoms/zprofile +++ b/.zprezto/runcoms/zprofile @@ -19,7 +19,7 @@ fi export EDITOR='vim' export VISUAL='vim' -export PAGER='most' +export PAGER='less' # # Language diff --git a/.zprezto/runcoms/zshrc b/.zprezto/runcoms/zshrc index 719a710..a8f192f 100644 --- a/.zprezto/runcoms/zshrc +++ b/.zprezto/runcoms/zshrc @@ -18,7 +18,7 @@ setopt NO_HUP # setopt IGNORE_EOF # If I could disable Ctrl-s completely I would! setopt NO_FLOW_CONTROL -unsetopt normstarsilent +# unsetopt normstarsilent ## Keep echo "station" > station from clobbering station #setopt NO_CLOBBER @@ -35,6 +35,14 @@ setopt NUMERIC_GLOB_SORT 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 +# disable running directory names +unsetopt AUTO_CD + +# return in functions if a command fails +# setopt ERR_RETURN + + + # Who doesn't want home and end to work? bindkey '\e[1~' beginning-of-line bindkey '\e[4~' end-of-line @@ -42,50 +50,18 @@ bindkey '\e[4~' end-of-line bindkey "\eOH" beginning-of-line bindkey "\eOF" end-of-line -# disable running directory names -unsetopt AUTO_CD . ~/.zalias -export R="$HOME/work/google3" - -function .g-init() { - git init --bare $HOME/.dotgit - .g config --local status.showUntrackedFiles no - .g remote add origin ssh://dedi/root/.dotgit - git config --global user.name "Your Name" - git config --global user.email you@example.com - .g remote add origin ssh://dedi/var/www/git.abra.me/dot.git -} +# export R="$HOME/work/google3" -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/ -} - -function latest() { - echo -n ("${(@f)$(ls *(om[1,$1]))}") -} - # ----------------------------------- END ALIASES -------------------------------------------------- -export EDITOR=/usr/bin/vim +# export EDITOR=/usr/bin/vim export PATH=$HOME/brew/sbin:$HOME/brew/bin:$HOME/bin:$PATH export DYLD_LIBRARY_PATH="/Developer/NVIDIA/CUDA-8.0/lib:/usr/local/cuda/lib" # added by travis gem -[ -f /Users/abra/.travis/travis.sh ] && source /Users/abra/.travis/travis.sh +# [ -f /Users/abra/.travis/travis.sh ] && source /Users/abra/.travis/travis.sh