2016-02-24 00:18:23 +01:00
|
|
|
# bip at command end
|
2019-03-05 15:41:01 +01:00
|
|
|
function precmd() {
|
|
|
|
|
echo -n -e "\a"
|
2019-03-07 14:40:12 +01:00
|
|
|
if [ "$HISTFILE" != "/home/hybris/.zsh_history" ]; then
|
2019-03-05 15:41:01 +01:00
|
|
|
echo "\e[31mUsing local history\e[39m"
|
|
|
|
|
fi
|
|
|
|
|
}
|
2016-02-24 00:18:23 +01:00
|
|
|
|
|
|
|
|
# do not share history between terms...
|
|
|
|
|
unsetopt share_history
|
|
|
|
|
|
2018-01-30 17:37:08 +01:00
|
|
|
# Load keychain
|
2018-02-22 15:58:56 +01:00
|
|
|
keychain -q --agents ssh id_rsa id_dsa
|
2018-01-30 17:37:08 +01:00
|
|
|
|
2016-02-24 00:18:23 +01:00
|
|
|
# Everyday aliases
|
2019-03-07 14:45:47 +01:00
|
|
|
c-cat() {for a in $@; do colorize_via_pygmentize $a; done}
|
2019-03-07 14:44:39 +01:00
|
|
|
c-less() {for a in $@; do colorize_via_pygmentize $a | less; done}
|
|
|
|
|
e() {emacsclient -n $@ > /dev/null 2>&1}
|
|
|
|
|
health() {/usr/bin/screen -O -S health -c ~/.config/screen_health}
|
|
|
|
|
j() {if [ $# -eq 0 ]; then marks; else jump $@; fi}
|
|
|
|
|
loop() {while [ 1 ]; do sh -c "$@"; done}
|
|
|
|
|
open_ports() {sudo netstat -tulpen 2> /dev/null | grep "LISTEN"}
|
|
|
|
|
r() {if [ $# -eq 1 ]; then ssh root@$1; else sudo su -; fi}
|
|
|
|
|
dontknow() {echo -n "¯\\_(ツ)_/¯" | xclip}
|
|
|
|
|
def() {echo "default_path = '$PWD'" | awesome-client}
|
|
|
|
|
dchroot() {docker run --rm --privileged -ti $@ debian:stretch /bin/bash}
|
2019-03-07 14:54:36 +01:00
|
|
|
local-history() {mkdir -p /home/hybris/.directory_history/$PWD; HISTFILE=/home/hybris/.directory_history/$PWD/history; return 0}
|
|
|
|
|
global-history() {HISTFILE=/home/hybris/.zsh_history; return 0}
|
2017-03-29 18:03:20 +02:00
|
|
|
|
2017-11-30 15:28:17 +01:00
|
|
|
# Usefull bindings
|
2017-11-30 15:32:26 +01:00
|
|
|
bindkey "^[Od" backward-word
|
|
|
|
|
bindkey "^[Oc" forward-word
|
2016-02-24 00:18:23 +01:00
|
|
|
|
|
|
|
|
# Some exports
|
|
|
|
|
export EDITOR=emacsclient
|
|
|
|
|
export LESS=-cex2MRX
|
|
|
|
|
export LESSOPEN='|~/.lessfilter %s'
|
|
|
|
|
export LOGCHECK=60
|
2017-04-06 16:26:30 +02:00
|
|
|
export PATH=$HOME/.scripts:$PATH
|
2016-02-24 00:18:23 +01:00
|
|
|
export READNULLCMD=${PAGER:-/usr/bin/pager}
|
|
|
|
|
export WATCH=all
|
|
|
|
|
export WATCHFMT="%n has %a %l from %M"
|
2018-03-28 15:29:53 +02:00
|
|
|
|
|
|
|
|
# Some completions
|
2018-04-25 15:30:02 +02:00
|
|
|
compctl -K _completemarks j
|