1996-07-14 20:57:01 +02:00
|
|
|
umask 022
|
1995-06-02 12:48:24 +02:00
|
|
|
bindkey -v
|
|
|
|
|
2017-10-19 14:02:23 +02:00
|
|
|
REPORTTIME=2
|
2004-11-16 09:39:54 +01:00
|
|
|
|
1995-06-02 12:48:24 +02:00
|
|
|
alias amke=make
|
|
|
|
alias a=alias
|
|
|
|
alias h=history
|
|
|
|
alias j=jobs
|
|
|
|
alias v=vi
|
|
|
|
alias lo=logout
|
|
|
|
alias md=mkdir
|
|
|
|
alias pop=popd
|
|
|
|
alias rd=rmdir
|
|
|
|
alias fixsz='set noglob; eval `resize`;unset noglob'
|
2013-06-13 09:42:44 +02:00
|
|
|
alias ls='ls -Fv'
|
1999-10-12 22:15:43 +02:00
|
|
|
if ls -hld > /dev/null 2>/dev/null
|
|
|
|
then
|
2013-06-13 09:42:44 +02:00
|
|
|
alias ll='ls -lFhv'
|
1999-10-12 22:15:43 +02:00
|
|
|
else
|
2013-06-13 09:42:44 +02:00
|
|
|
alias ll='ls -lFv'
|
1999-10-12 22:15:43 +02:00
|
|
|
fi
|
1995-06-02 12:48:24 +02:00
|
|
|
alias la='ls -alsF'
|
1999-08-30 09:48:41 +02:00
|
|
|
alias cup='cvs -q update -d -P'
|
2005-12-20 20:37:38 +01:00
|
|
|
alias digs='dig +nocomments +nostats +nocmd'
|
2011-02-06 11:35:29 +01:00
|
|
|
if ack=`whence ack-grep`
|
2011-01-29 10:55:48 +01:00
|
|
|
then
|
2011-02-06 11:35:29 +01:00
|
|
|
alias ack=$ack
|
2011-01-29 10:55:48 +01:00
|
|
|
fi
|
2020-03-18 09:16:24 +01:00
|
|
|
alias darkbg='xtermcontrol --bg "#000" --fg "#FFF" --highlight="#00F"; export BG=dark'
|
2020-03-26 12:09:42 +01:00
|
|
|
alias lightbg='xtermcontrol --bg "#F0F0F0" --fg "#000" --highlight="#0FF"; export BG=light'
|
2014-08-23 22:01:59 +02:00
|
|
|
alias defaultbg='. ~/.zxtermcolors'
|
2019-09-08 12:19:56 +02:00
|
|
|
alias ag='ag --color-path "34;47"'
|
1995-07-27 10:20:11 +02:00
|
|
|
|
|
|
|
namedir(){
|
1997-07-19 15:40:36 +02:00
|
|
|
eval "$1=~+"
|
1995-07-27 10:20:11 +02:00
|
|
|
: ~$1
|
|
|
|
}
|
|
|
|
|
|
|
|
pd(){
|
|
|
|
if [[ $# = 0 ]]
|
|
|
|
then
|
|
|
|
pushd +1
|
|
|
|
else
|
|
|
|
pushd "$@"
|
|
|
|
fi
|
2018-02-07 09:25:24 +01:00
|
|
|
namedir $(echo $(basename "$PWD" | tr -cd 'A-Za-z0-9_') | tr 'A-Z' 'a-z' | sed -e 's/^[0-9]/_&/')
|
2015-04-29 09:02:46 +02:00
|
|
|
echo "$PWD"
|
1995-07-27 10:20:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
setenv(){
|
|
|
|
$1=$2
|
|
|
|
export $1
|
|
|
|
}
|
|
|
|
|
1999-08-21 23:48:23 +02:00
|
|
|
harden(){
|
|
|
|
cp -p "$1" .harden.$$ && mv .harden.$$ "$1"
|
|
|
|
}
|
|
|
|
|
2015-07-21 13:48:01 +02:00
|
|
|
moveoutoftheway(){
|
|
|
|
mv "$1" "$1".old
|
|
|
|
}
|
|
|
|
|
2001-05-01 20:17:39 +02:00
|
|
|
dup(){
|
|
|
|
mv $1 $1.orig && cp -p $1.orig $1
|
|
|
|
}
|
|
|
|
|
1995-06-02 12:48:24 +02:00
|
|
|
cls() { clear; true }
|
|
|
|
|
2016-11-21 14:54:57 +01:00
|
|
|
man () {
|
|
|
|
LESS_TERMCAP_mb=$'\e'"[1;31m" \
|
|
|
|
LESS_TERMCAP_md=$'\e'"[1;38;5;88m" \
|
|
|
|
LESS_TERMCAP_me=$'\e'"[0m" \
|
|
|
|
LESS_TERMCAP_se=$'\e'"[0m" \
|
|
|
|
LESS_TERMCAP_so=$'\e'"[1;44;33m" \
|
|
|
|
LESS_TERMCAP_ue=$'\e'"[0m" \
|
|
|
|
LESS_TERMCAP_us=$'\e'"[1;38;5;22m" \
|
|
|
|
command man "$@"
|
|
|
|
}
|
|
|
|
|
2017-09-27 09:40:01 +02:00
|
|
|
venv() {
|
2017-10-19 12:13:34 +02:00
|
|
|
for d in venv/"$1" ve/"$1" ~/venv/"$1" "$1"
|
2017-09-27 09:40:01 +02:00
|
|
|
do
|
|
|
|
if [ -f "$d"/bin/activate ]
|
|
|
|
then
|
|
|
|
. "$d"/bin/activate
|
2017-10-19 12:13:34 +02:00
|
|
|
break
|
2017-09-27 09:40:01 +02:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2021-10-16 17:30:36 +02:00
|
|
|
locale_en () {
|
|
|
|
export LANGUAGE=en_US:en
|
|
|
|
export LANG=en_US.UTF-8
|
|
|
|
}
|
|
|
|
|
1997-07-25 00:02:10 +02:00
|
|
|
source ~/.znewterm
|
2004-04-23 22:33:05 +02:00
|
|
|
|
2004-06-22 12:03:03 +02:00
|
|
|
# assume pseudo terminals are from a "safe" terminal
|
|
|
|
# other terminals are probably from a console and should
|
|
|
|
# auto-logout after some time.
|
|
|
|
case `tty` in
|
|
|
|
/dev/pts/*)
|
2004-10-25 12:54:21 +02:00
|
|
|
TMOUT=14400
|
2004-06-22 12:03:03 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
TMOUT=3600
|
|
|
|
esac
|
2006-07-10 17:22:01 +02:00
|
|
|
|
2009-09-24 15:29:33 +02:00
|
|
|
# and screen sessions shouldn't terminate at all ...
|
|
|
|
case "$TERM" in
|
|
|
|
screen)
|
|
|
|
unset TMOUT
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2006-07-10 17:22:01 +02:00
|
|
|
if [ -z "$EDITOR" ]
|
|
|
|
then
|
|
|
|
export EDITOR=vi
|
|
|
|
fi
|
2007-03-01 12:57:44 +01:00
|
|
|
|
|
|
|
# prepend local function dir if we have one.
|
|
|
|
#
|
|
|
|
# Important: Don't clobber FPATH. It's needed for completion and usually
|
|
|
|
# contains a lot of directories (at least on Debian systems) and you
|
|
|
|
# don't want to recreate that mess manually.
|
|
|
|
if [ -d ~/bin/func ]
|
|
|
|
then
|
2020-03-30 16:42:05 +02:00
|
|
|
export FPATH
|
2007-03-01 12:57:44 +01:00
|
|
|
FPATH=`preppath -v FPATH ~/bin/func`
|
2020-03-30 16:42:05 +02:00
|
|
|
# We also have to mark all functions explicitely as undefined,
|
|
|
|
# or zsh won't look for them. (Is this new? I thought that zsh would
|
|
|
|
# automatically search for unknown commands in FPATH, too. Maybe
|
|
|
|
# there's an option for that.)
|
|
|
|
for f in ~/bin/func/*
|
|
|
|
do
|
|
|
|
typeset -fu $(basename $f)
|
|
|
|
done
|
2007-03-01 12:57:44 +01:00
|
|
|
fi
|
2007-03-07 12:16:09 +01:00
|
|
|
|
|
|
|
# for new style completion:
|
|
|
|
autoload -U compinit
|
|
|
|
compinit
|
2023-08-08 15:51:24 +02:00
|
|
|
|
|
|
|
# NVM
|
|
|
|
if [ -d "$HOME/.nvm" ]
|
|
|
|
then
|
|
|
|
export NVM_DIR="$HOME/.nvm"
|
|
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
|
|
fi
|