zsh/zshrc

84 lines
1.5 KiB
Bash
Raw Normal View History

HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000
unsetopt histsavenodups
2014-06-27 05:45:18 +00:00
setopt autocd extendedglob notify correct autonamedirs
setopt list_ambiguous autopushd pushd_ignore_dups
setopt hist_ignore_space share_history
#setopt hist_ignore_all_dups
setopt no_auto_remove_slash auto_param_slash
setopt completeinword
setopt chase_links
setopt short_loops
setopt cdable_vars
2020-04-02 16:21:55 +00:00
WORDCHARS=${WORDCHARS//\/}
export ZDOTDIR=${ZDOTDIR:-$HOME/.zsh}
2020-02-13 13:21:42 +00:00
function exists { command -v "$@" >/dev/null }
2016-07-25 11:48:52 +00:00
# get a file from ZDOTDIR, return file in /etc/zsh if it does not exist
zdotfile() {
if [[ -e $ZDOTDIR/$1 ]]; then
echo $ZDOTDIR/$1
else
echo /etc/zsh/$1
fi
}
try-source() {
2020-04-29 08:35:23 +00:00
local i=0
for i in "$@"; do
if [[ -e "$i" ]]; then
source $i
fi
done
}
2021-02-06 12:30:20 +00:00
# run hash -r after the given command. Useful for package manager commands that
# change installed packages
hashafter () {
local fname=$1
eval "
function $fname() {
command $fname \"\$@\"
hash -r
}
"
}
exists() { command -v "$@" >/dev/null }
2020-04-29 08:35:23 +00:00
function(){
try-source $(zdotfile dirs)
}
2019-05-14 12:45:13 +00:00
2019-02-11 14:36:37 +00:00
. $(zdotfile completion.zsh)
source $(zdotfile zplug.zsh)
. $(zdotfile bindings.zsh)
2016-01-05 02:45:19 +00:00
stty -ixon
2020-04-29 08:35:23 +00:00
function(){
local i=0
for i in ${ZDOTDIR:+$ZDOTDIR/aliases/*~*.zwc(N)} /etc/zsh/aliases/*~*.zwc(N); do
. $i
done
}
2016-01-05 03:34:13 +00:00
if ! (grep -q 'local' <<<$PATH && grep -q 'sbin' <<<$PATH); then
. /etc/zsh/zprofile
fi
2018-05-14 13:09:22 +00:00
FZF_ALT_C_COMMAND="fd -t d"
2020-02-13 13:21:42 +00:00
if exists stack; then
eval "$(stack --bash-completion-script stack)"
fi
exists todo && todo
exists thefuck && eval $(thefuck --alias)