reverted to before zulu

This commit is contained in:
Nikolas Weger 2017-07-20 09:19:38 +02:00
parent 6209d6f656
commit 3f5e822fb3
21 changed files with 216 additions and 48 deletions

28
zsh/aliases.d/cd.zsh Normal file
View file

@ -0,0 +1,28 @@
# CD
alias ..='cd ../'
alias ...='cd ../../'
alias ....='cd ../../../'
alias .....='cd ../../../../'
# Go up [n] directories
function up()
{
local cdir="$(pwd)"
if [[ "${1}" == "" ]]; then
cdir="$(dirname "${cdir}")"
elif ! [[ "${1}" =~ ^[0-9]+$ ]]; then
echo "Error: argument must be a number"
elif ! [[ "${1}" -gt "0" ]]; then
echo "Error: argument must be positive"
else
for i in {1..${1}}; do
local ncdir="$(dirname "${cdir}")"
if [[ "${cdir}" == "${ncdir}" ]]; then
break
else
cdir="${ncdir}"
fi
done
fi
cd "${cdir}"
}

5
zsh/aliases.d/find.zsh Normal file
View file

@ -0,0 +1,5 @@
# Du/Find
alias dud='du -d 1 -h'
alias duf='du -sh *'
alias fd='find . -type d -name'
alias ff='find . -type f -name'

4
zsh/aliases.d/grep.zsh Normal file
View file

@ -0,0 +1,4 @@
# Grep
alias grep='grep --color'
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}'
alias psg='ps aux | grep -v grep | grep'

View file

@ -0,0 +1,5 @@
# Interactive
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

10
zsh/aliases.d/list.zsh Normal file
View file

@ -0,0 +1,10 @@
# Listing
alias l='ls -lFh' #size,show type,human readable
alias la='ls -lAFh' #long list,show almost all,show type,human readable
alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable
alias lt='ls -ltFh' #long list,sorted by date,show type,human readable
alias ll='ls -l' #long list
alias ldot='ls -ld .*'
alias lS='ls -1FSsh'
alias lart='ls -1Fcart'
alias lrt='ls -1Fcrt'

20
zsh/aliases.d/own.zsh Normal file
View file

@ -0,0 +1,20 @@
# Command Line Foo
alias clf='clf --color'
# The Fuck
TF_ALIAS=fuck alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R'
# PClear
pclear () {
clear
printf '\033[3J'
}
# Termbin
alias tb='nc termbin.com 9999'
# Make Dir and enter it
mkcd() {
mkdir $1 >/dev/null 2>&1
[ -e $1 ] && cd $1
}

7
zsh/aliases.d/stuff.zsh Normal file
View file

@ -0,0 +1,7 @@
# Stuff
alias h='history'
alias hgrep="fc -El 0 | grep"
alias j='jobs'
alias p='ps -f'
alias sortnr='sort -n -r'

2
zsh/aliases.d/tail.zsh Normal file
View file

@ -0,0 +1,2 @@
# Tail
alias t='tail -f'

View file

@ -0,0 +1,54 @@
#
# Defines transfer alias and provides easy command line file and folder sharing.
#
# Authors:
# Remco Verhoef <remco@dutchcoders.io>
#
transfer() {
# check arguments
if [ $# -eq 0 ];
then
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
fi
# get temporarily filename, output is written to this file show progress can be showed
tmpfile=$( mktemp -t transferXXX )
# upload stdin or file
file=$1
if tty -s;
then
basefile=$(basename "$file" | sed -e 's/[^a-zA-Z0-9._-]/-/g')
if [ ! -e $file ];
then
echo "File $file doesn't exists."
return 1
fi
if [ -d $file ];
then
# zip directory and transfer
zipfile=$( mktemp -t transferXXX.zip )
cd $(dirname $file) && zip -r -q - $(basename $file) >> $zipfile
curl --progress-bar --upload-file "$zipfile" "https://transfer.sh/$basefile.zip" >> $tmpfile
rm -f $zipfile
else
# transfer file
curl --progress-bar --upload-file "$file" "https://transfer.sh/$basefile" >> $tmpfile
fi
else
# transfer pipe
curl --progress-bar --upload-file "-" "https://transfer.sh/$file" >> $tmpfile
fi
# cat output link
cat $tmpfile
# cleanup
rm -f $tmpfile
}

View file

@ -1,61 +1,52 @@
# Oh My ZSH Path
# Exports
export ZSH=${HOME}/dotfiles/lib/ohmyzsh
# Oh My ZSH Theme
ZSH_THEME="mortalscumbag"
# Disable Auto Update of Oh My ZSH
DISABLE_AUTO_UPDATE="true"
# Go Path
export GOPATH=${HOME}/go
# Path
export PATH="${GOPATH}/bin:${HOME}/.gem/ruby/2.2.0/bin:${HOME}/dotfiles/lib/util:${HOME}/dotfiles/lib/dasht/bin:${PATH}"
# Dasht
export PATH="${GOPATH}/bin:${HOME}/.gem/ruby/2.3.0/bin:${HOME}/dotfiles/lib/util:${HOME}/dotfiles/lib/bin:${HOME}/dotfiles/lib/dasht/bin:${PATH}:/opt/android-sdk/build-tools/26.0.0/"
export DASHT_DOCSETS_DIR=$HOME/.local/share/Zeal/Zeal/docsets
export EDITOR='nano'
export TERM=linux
# Plugins
plugins=(gem bundler composer git vagrant docker python)
plugins+=(npm systemd systemadmin gitignore tmux extract)
plugins+=(command-not-found colored-man-pages fabric ansible)
plugins=(gem bundler git vagrant docker python ansible)
plugins+=(systemd systemadmin tmux command-not-found extract)
case $(uname -n) in
"megumi")
plugins+=(archlinux)
;;
"sayaka")
plugins+=(archlinux)
;;
"git")
plugins+=(debian)
;;
"test")
plugins+=(debian)
;;
esac
if [ $(uname -n) = "megumi" -o $(uname -n) = "kimari" -o $(uname -n) = "sayaka" ]; then
plugins+=(archlinux)
fi
if [ $(uname -n) = "mx" -o $(uname -n) = "git" ]; then
plugins+=(debian)
fi
# Preferred editor for local and remote sessions
export EDITOR='nano'
# Load Oh My ZSH
# OMZ
source ${ZSH}/oh-my-zsh.sh
# Fix home/end key at work
bindkey "^[[1~" beginning-of-line
bindkey "^[[4~" end-of-line
# Fix MobaXterm Home/End key with ZSH
bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line
# Source k.sh
source ${HOME}/dotfiles/lib/k/k.sh
# Shell Syntax Highlighter
# Syntax Highlighting
source ${HOME}/dotfiles/lib/highlighting/zsh-syntax-highlighting.zsh
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
# Aliases
for file in ${HOME}/dotfiles/zsh/aliases.d/*.zsh; do
source $file
done
# FZF
[ -f ${HOME}/.fzf.zsh ] && source ${HOME}/.fzf.zsh
# Dircolors
eval `dircolors ${HOME}/dotfiles/zsh/dircolors`
# Source Aliases
source ${HOME}/dotfiles/zsh/aliases.zsh
# Source FZF
[ -f ${HOME}/.fzf.zsh ] && source ${HOME}/.fzf.zsh
# Completions Path
fpath=(${HOME}/dotfiles/lib/completions/src $fpath)
# Source local zshrc
[ -f ${HOME}/local.zshrc ] && source ${HOME}/local.zshrc