Compare commits

...

10 Commits
work ... master

4 changed files with 64 additions and 4 deletions

@ -1 +1 @@
Subproject commit 9fed026ab76016f71df5dac7db9686c364b07c21 Subproject commit 69118b111d4cc6dc78edd64a5a724b6871cccff4

16
.githooks/pre-push Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
wips=$(git log --oneline --no-decorate | grep -i wip )
wips_n=$(echo "$wips" | wc -l)
LOCKFILE=/tmp/githook.allow_wip
if [[ ! -f $LOCKFILE && -n "$wips" ]]; then
# Allows us to read user input below, assigns stdin to keyboard
exec < /dev/tty
echo "contains $wips_n WIP commit(s)"
read -p "Really push? (Y/N) " -n 1 -r
case "$REPLY" in
y|Y ) echo -e "\ncontinuing..."; touch $LOCKFILE;;
* ) echo -e "\naborting."; exit 1;;
esac
fi

2
.gitignore vendored
View File

@ -6,6 +6,8 @@
!.zprofile !.zprofile
!.vimrc !.vimrc
!.ideavimrc !.ideavimrc
!.githooks
!.githooks/**
!.config !.config
!.config/nvim !.config/nvim
!.config/nvim/** !.config/nvim/**

42
.zshrc
View File

@ -1,4 +1,6 @@
### ENVVARS ### ENVVARS
# zmodload zsh/zprof # for profiling, also uncomment last line
source "$HOME/.zprofile" source "$HOME/.zprofile"
source "$HOME/.config/user-dirs.dirs" source "$HOME/.config/user-dirs.dirs"
export TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P' export TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
@ -31,6 +33,7 @@ alias isotime='date +"%Y-%m-%dT%H:%M:%S%z"'
alias isodate='date +%Y-%m-%dT%H:%M:%S%z' alias isodate='date +%Y-%m-%dT%H:%M:%S%z'
alias datefmt='date $DATEFMT' alias datefmt='date $DATEFMT'
alias gg=lazygit alias gg=lazygit
alias sg=sourcegit
alias reload="source ~/.zshrc" alias reload="source ~/.zshrc"
alias gls=/bin/ls alias gls=/bin/ls
alias bat=batcat alias bat=batcat
@ -42,6 +45,9 @@ alias psa="ps -eadf"
alias fsize="stat --printf='%s'" alias fsize="stat --printf='%s'"
alias rg="rg --no-ignore" alias rg="rg --no-ignore"
alias home="cd $HOME" alias home="cd $HOME"
alias ff=firefox
alias fd=fdfind
# alias shutdown="confirm shutdown"
### Functions ### Functions
function largefiles () { exec 2>/dev/null; du -ah "$@" | grep -P "^\d+(G|T|P|E)\s" } function largefiles () { exec 2>/dev/null; du -ah "$@" | grep -P "^\d+(G|T|P|E)\s" }
@ -92,6 +98,27 @@ else
fi fi
return $ret return $ret
} }
function confirm() {
bash -c "
echo \"To be executed: $@\";
read -p \"Confirm (Y/N): \" -n 1 -r;
case \"\$REPLY\" in
y|Y ) echo \"es\"; eval $@;;
n|N ) echo \"o\";;
* ) echo -e \"\ninvalid\";;
esac" $@
}
function confirm-important() {
echo "Write 'yes do as i say' to confirm that you REALLY want to do this: $@"
read
if [[ "${REPLY,,}" = "yes do as i say" ]]
then
eval $@
else
echo "aborting"
fi
}
### ---- zsh options ------------------------------------- ### ---- zsh options -------------------------------------
setopt autocd setopt autocd
@ -210,6 +237,7 @@ fpath=($ZSH/plugins/zsh-completions/src $fpath)
ZAQ_PREFIXES+=('git commit( [^ ]##)# -[^ -]#m') ZAQ_PREFIXES+=('git commit( [^ ]##)# -[^ -]#m')
ZAQ_PREFIXES_GREEDY+=('py #') ZAQ_PREFIXES_GREEDY+=('py #')
ZAQ_PREFIXES_GREEDY+=('c #')
ZAQ_PREFIXES_GREEDY+=('countlines #') ZAQ_PREFIXES_GREEDY+=('countlines #')
### --- fzf Config ------------------------------------ ### --- fzf Config ------------------------------------
@ -259,3 +287,17 @@ eval "$(pyenv virtualenv-init - zsh)"
zstyle ':completion:*' menu select zstyle ':completion:*' menu select
fpath+=~/.zfunc fpath+=~/.zfunc
export NVM_DIR="$HOME/.config/nvm"
# diese Scheiße läd so ewig, wer auch immer dachte dass das so eine gute idee
# ist gehört gefeuert. Das muss jeden Tag viele leute minuten kosten.
# [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# on demand nvm
function load_nvm() {
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
}
alias nvim="load_nvm && nvim"
# zprof